From: Yunsheng Lin <linyunsheng@huawei.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Yisen Zhuang <yisen.zhuang@huawei.com>
Cc: Salil Mehta <salil.mehta@huawei.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Huazhong Tan <tanhuazhong@huawei.com>,
Yonglong Liu <liuyonglong@huawei.com>,
Yufeng Mo <moyufeng@huawei.com>,
Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>,
Guangbin Huang <huangguangbin2@huawei.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH net] net: hns3: clean up a return in hclge_tm_bp_setup()
Date: Mon, 26 Oct 2020 11:18:16 +0800 [thread overview]
Message-ID: <3fbcbfbd-deea-162e-9281-29e65b90996b@huawei.com> (raw)
In-Reply-To: <20201023112212.GA282278@mwanda>
On 2020/10/23 19:22, Dan Carpenter wrote:
> Smatch complains that "ret" might be uninitialized if we don't enter
> the loop. We do always enter the loop so it's a false positive, but
> it's cleaner to just return a literal zero and that silences the
> warning as well.
Thanks for the clean up. Minor comment below:
Perhap it makes sense to limit ret scope within the for loop after
returning zero.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
> index 15f69fa86323..e8495f58a1a8 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
> @@ -1373,7 +1373,7 @@ static int hclge_tm_bp_setup(struct hclge_dev *hdev)
> return ret;
> }
>
> - return ret;
> + return 0;
> }
>
> int hclge_pause_setup_hw(struct hclge_dev *hdev, bool init)
>
next prev parent reply other threads:[~2020-10-26 3:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-23 11:22 [PATCH net] net: hns3: clean up a return in hclge_tm_bp_setup() Dan Carpenter
2020-10-26 3:18 ` Yunsheng Lin [this message]
2020-10-26 6:52 ` Dan Carpenter
2020-10-26 23:17 ` Jakub Kicinski
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=3fbcbfbd-deea-162e-9281-29e65b90996b@huawei.com \
--to=linyunsheng@huawei.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=huangguangbin2@huawei.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=moyufeng@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pankaj.laxminarayan.bharadiya@intel.com \
--cc=salil.mehta@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).