linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: hns3: avoid -Wpointer-bool-conversion warning
@ 2021-02-04 15:38 Arnd Bergmann
  2021-02-04 21:23 ` Nathan Chancellor
  2021-02-05  3:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-02-04 15:38 UTC (permalink / raw)
  To: Yisen Zhuang, Salil Mehta, David S. Miller, Jakub Kicinski,
	Nathan Chancellor, Nick Desaulniers, Guangbin Huang,
	Huazhong Tan
  Cc: Arnd Bergmann, Yufeng Mo, Jian Shen, Yonglong Liu, netdev,
	linux-kernel, clang-built-linux

From: Arnd Bergmann <arnd@arndb.de>

clang points out a redundant sanity check:

drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c:497:28: error: address of array 'filp->f_path.dentry->d_iname' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]

This can never fail, so just remove the check.

Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority and qset info")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 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] 3+ messages in thread

* Re: [PATCH] net: hns3: avoid -Wpointer-bool-conversion warning
  2021-02-04 15:38 [PATCH] net: hns3: avoid -Wpointer-bool-conversion warning Arnd Bergmann
@ 2021-02-04 21:23 ` Nathan Chancellor
  2021-02-05  3:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2021-02-04 21:23 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Yisen Zhuang, Salil Mehta, David S. Miller, Jakub Kicinski,
	Nick Desaulniers, Guangbin Huang, Huazhong Tan, Arnd Bergmann,
	Yufeng Mo, Jian Shen, Yonglong Liu, netdev, linux-kernel,
	clang-built-linux

On Thu, Feb 04, 2021 at 04:38:06PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> clang points out a redundant sanity check:
> 
> drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c:497:28: error: address of array 'filp->f_path.dentry->d_iname' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
> 
> This can never fail, so just remove the check.
> 
> Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority and qset info")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  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	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: hns3: avoid -Wpointer-bool-conversion warning
  2021-02-04 15:38 [PATCH] net: hns3: avoid -Wpointer-bool-conversion warning Arnd Bergmann
  2021-02-04 21:23 ` Nathan Chancellor
@ 2021-02-05  3:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-05  3:00 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: yisen.zhuang, salil.mehta, davem, kuba, nathan, ndesaulniers,
	huangguangbin2, tanhuazhong, arnd, moyufeng, shenjian15,
	liuyonglong, netdev, linux-kernel, clang-built-linux

Hello:

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

On Thu,  4 Feb 2021 16:38:06 +0100 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> clang points out a redundant sanity check:
> 
> drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c:497:28: error: address of array 'filp->f_path.dentry->d_iname' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
> 
> This can never fail, so just remove the check.
> 
> [...]

Here is the summary with links:
  - net: hns3: avoid -Wpointer-bool-conversion warning
    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] 3+ messages in thread

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 15:38 [PATCH] net: hns3: avoid -Wpointer-bool-conversion warning Arnd Bergmann
2021-02-04 21:23 ` Nathan Chancellor
2021-02-05  3:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).