From: Nathan Chancellor <nathan@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Yisen Zhuang <yisen.zhuang@huawei.com>,
Salil Mehta <salil.mehta@huawei.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Guangbin Huang <huangguangbin2@huawei.com>,
Huazhong Tan <tanhuazhong@huawei.com>,
Arnd Bergmann <arnd@arndb.de>, Yufeng Mo <moyufeng@huawei.com>,
Jian Shen <shenjian15@huawei.com>,
Yonglong Liu <liuyonglong@huawei.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
clang-built-linux@googlegroups.com
Subject: Re: [PATCH] net: hns3: avoid -Wpointer-bool-conversion warning
Date: Thu, 4 Feb 2021 14:23:06 -0700 [thread overview]
Message-ID: <20210204212306.GB385551@localhost> (raw)
In-Reply-To: <20210204153813.1520736-1-arnd@kernel.org>
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
>
next prev parent reply other threads:[~2021-02-04 21:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-04 15:38 [PATCH] net: hns3: avoid -Wpointer-bool-conversion warning Arnd Bergmann
2021-02-04 21:23 ` Nathan Chancellor [this message]
2021-02-05 3:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210204212306.GB385551@localhost \
--to=nathan@kernel.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=davem@davemloft.net \
--cc=huangguangbin2@huawei.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=moyufeng@huawei.com \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=shenjian15@huawei.com \
--cc=tanhuazhong@huawei.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).