All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] net: hns3: remove redundant assignment to pointer reg_info
@ 2019-08-31  7:29 ` Colin King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2019-08-31  7:29 UTC (permalink / raw)
  To: Yisen Zhuang, Salil Mehta, David S . Miller, Huazhong Tan,
	Zhongzhu Liu, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Pointer reg_info is being initialized with a value that is never read and
is being re-assigned a little later on. The assignment is redundant
and hence can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
index 1debe37fe735..1c6b501fb7ca 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
@@ -279,7 +279,7 @@ static void hclge_dbg_dump_dcb(struct hclge_dev *hdev, const char *cmd_buf)
 
 static void hclge_dbg_dump_reg_cmd(struct hclge_dev *hdev, const char *cmd_buf)
 {
-	struct hclge_dbg_reg_type_info *reg_info = &hclge_dbg_reg_info[0];
+	struct hclge_dbg_reg_type_info *reg_info;
 	bool has_dump = false;
 	int i;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH][next] net: hns3: remove redundant assignment to pointer reg_info
@ 2019-08-31  7:29 ` Colin King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2019-08-31  7:29 UTC (permalink / raw)
  To: Yisen Zhuang, Salil Mehta, David S . Miller, Huazhong Tan,
	Zhongzhu Liu, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Pointer reg_info is being initialized with a value that is never read and
is being re-assigned a little later on. The assignment is redundant
and hence can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
index 1debe37fe735..1c6b501fb7ca 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
@@ -279,7 +279,7 @@ static void hclge_dbg_dump_dcb(struct hclge_dev *hdev, const char *cmd_buf)
 
 static void hclge_dbg_dump_reg_cmd(struct hclge_dev *hdev, const char *cmd_buf)
 {
-	struct hclge_dbg_reg_type_info *reg_info = &hclge_dbg_reg_info[0];
+	struct hclge_dbg_reg_type_info *reg_info;
 	bool has_dump = false;
 	int i;
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH][next] net: hns3: remove redundant assignment to pointer reg_info
  2019-08-31  7:29 ` Colin King
@ 2019-09-01 19:12   ` David Miller
  -1 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2019-09-01 19:12 UTC (permalink / raw)
  To: colin.king
  Cc: yisen.zhuang, salil.mehta, tanhuazhong, liuzhongzhu, netdev,
	kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Sat, 31 Aug 2019 08:29:49 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointer reg_info is being initialized with a value that is never read and
> is being re-assigned a little later on. The assignment is redundant
> and hence can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH][next] net: hns3: remove redundant assignment to pointer reg_info
@ 2019-09-01 19:12   ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2019-09-01 19:12 UTC (permalink / raw)
  To: colin.king
  Cc: yisen.zhuang, salil.mehta, tanhuazhong, liuzhongzhu, netdev,
	kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Sat, 31 Aug 2019 08:29:49 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointer reg_info is being initialized with a value that is never read and
> is being re-assigned a little later on. The assignment is redundant
> and hence can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH][next] net: hns3: remove redundant null check of an array
  2019-08-31  7:29 ` Colin King
@ 2021-02-03 13:10 ` Colin King
  -1 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2021-02-03 13:10 UTC (permalink / raw)
  To: Yisen Zhuang, Salil Mehta, David S . Miller, Jakub Kicinski,
	Huazhong Tan, Guangbin Huang, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The null check of filp->f_path.dentry->d_iname is redundant because
it is an array of DNAME_INLINE_LEN chars and cannot be a null. Fix
this by removing the null check.

Addresses-Coverity: ("Array compared against 0")
Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority and qset info")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 6978304f1ac5..c5958754f939 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -494,9 +494,6 @@ static ssize_t hns3_dbg_read(struct file *filp, char __user *buffer,
 	ssize_t size = 0;
 	int ret = 0;
 
-	if (!filp->f_path.dentry->d_iname)
-		return -EINVAL;
-
 	read_buf = kzalloc(HNS3_DBG_READ_LEN, GFP_KERNEL);
 	if (!read_buf)
 		return -ENOMEM;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH][next] net: hns3: remove redundant null check of an array
@ 2021-02-03 13:10 ` Colin King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2021-02-03 13:10 UTC (permalink / raw)
  To: Yisen Zhuang, Salil Mehta, David S . Miller, Jakub Kicinski,
	Huazhong Tan, Guangbin Huang, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The null check of filp->f_path.dentry->d_iname is redundant because
it is an array of DNAME_INLINE_LEN chars and cannot be a null. Fix
this by removing the null check.

Addresses-Coverity: ("Array compared against 0")
Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority and qset info")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 6978304f1ac5..c5958754f939 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -494,9 +494,6 @@ static ssize_t hns3_dbg_read(struct file *filp, char __user *buffer,
 	ssize_t size = 0;
 	int ret = 0;
 
-	if (!filp->f_path.dentry->d_iname)
-		return -EINVAL;
-
 	read_buf = kzalloc(HNS3_DBG_READ_LEN, GFP_KERNEL);
 	if (!read_buf)
 		return -ENOMEM;
-- 
2.29.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH][next] net: hns3: remove redundant null check of an array
  2021-02-03 13:10 ` Colin King
@ 2021-02-03 23:24   ` Jesse Brandeburg
  -1 siblings, 0 replies; 9+ messages in thread
From: Jesse Brandeburg @ 2021-02-03 23:24 UTC (permalink / raw)
  To: Colin King
  Cc: Yisen Zhuang, Salil Mehta, David S . Miller, Jakub Kicinski,
	Huazhong Tan, Guangbin Huang, netdev, kernel-janitors,
	linux-kernel

Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The null check of filp->f_path.dentry->d_iname is redundant because
> it is an array of DNAME_INLINE_LEN chars and cannot be a null. Fix
> this by removing the null check.
> 
> Addresses-Coverity: ("Array compared against 0")
> Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority and qset info")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH][next] net: hns3: remove redundant null check of an array
@ 2021-02-03 23:24   ` Jesse Brandeburg
  0 siblings, 0 replies; 9+ messages in thread
From: Jesse Brandeburg @ 2021-02-03 23:24 UTC (permalink / raw)
  To: Colin King
  Cc: Yisen Zhuang, Salil Mehta, David S . Miller, Jakub Kicinski,
	Huazhong Tan, Guangbin Huang, netdev, kernel-janitors,
	linux-kernel

Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The null check of filp->f_path.dentry->d_iname is redundant because
> it is an array of DNAME_INLINE_LEN chars and cannot be a null. Fix
> this by removing the null check.
> 
> Addresses-Coverity: ("Array compared against 0")
> Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority and qset info")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH][next] net: hns3: remove redundant null check of an array
  2021-02-03 13:10 ` Colin King
  (?)
  (?)
@ 2021-02-05  3:00 ` patchwork-bot+netdevbpf
  -1 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-05  3:00 UTC (permalink / raw)
  To: Colin King
  Cc: yisen.zhuang, salil.mehta, davem, kuba, tanhuazhong,
	huangguangbin2, netdev, kernel-janitors, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Wed,  3 Feb 2021 13:10:40 +0000 you wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The null check of filp->f_path.dentry->d_iname is redundant because
> it is an array of DNAME_INLINE_LEN chars and cannot be a null. Fix
> this by removing the null check.
> 
> Addresses-Coverity: ("Array compared against 0")
> Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority and qset info")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> [...]

Here is the summary with links:
  - [next] net: hns3: remove redundant null check of an array
    https://git.kernel.org/netdev/net-next/c/8f8a42ff003a

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-05  3:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 13:10 [PATCH][next] net: hns3: remove redundant null check of an array Colin King
2021-02-03 13:10 ` Colin King
2021-02-03 23:24 ` Jesse Brandeburg
2021-02-03 23:24   ` Jesse Brandeburg
2021-02-05  3:00 ` patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2019-08-31  7:29 [PATCH][next] net: hns3: remove redundant assignment to pointer reg_info Colin King
2019-08-31  7:29 ` Colin King
2019-09-01 19:12 ` David Miller
2019-09-01 19:12   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.