diff mbox series

[net-next,7/7] net: hns3: remove unnecessary check in hns3_dbg_read()

Message ID 1612269593-18691-8-git-send-email-tanhuazhong@huawei.com
State New
Headers show
Series net: hns3: updates for -next | expand

Commit Message

Huazhong Tan Feb. 2, 2021, 12:39 p.m. UTC
Clang warns:

drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c:499:28: warning:
address of array 'filp->f_path.dentry->d_iname' will always evaluate
to 'true' [-Wpointer-bool-conversion]
        if (!filp->f_path.dentry->d_iname)

This check is unnecessary, so remove it.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 3 ---
 1 file changed, 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 448e7cd..894b454 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -496,9 +496,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;