lkml.org 
[lkml]   [2021]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] net: hns3: avoid -Wpointer-bool-conversion warning
Date
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
\
 
 \ /
  Last update: 2021-02-04 16:47    [W:0.062 / U:5.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site