From: Dan Carpenter <dan.carpenter@oracle.com>
To: Yunsheng Lin <linyunsheng@huawei.com>
Cc: Yisen Zhuang <yisen.zhuang@huawei.com>,
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 06:52:36 +0000 [thread overview]
Message-ID: <20201026065235.GG18329@kadam> (raw)
In-Reply-To: <3fbcbfbd-deea-162e-9281-29e65b90996b@huawei.com>
On Mon, Oct 26, 2020 at 11:18:16AM +0800, Yunsheng Lin wrote:
> 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.
>
It's not really normal to limit ret scope... I think it's better to
leave it as-is.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Yunsheng Lin <linyunsheng@huawei.com>
Cc: Yisen Zhuang <yisen.zhuang@huawei.com>,
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 09:52:36 +0300 [thread overview]
Message-ID: <20201026065235.GG18329@kadam> (raw)
In-Reply-To: <3fbcbfbd-deea-162e-9281-29e65b90996b@huawei.com>
On Mon, Oct 26, 2020 at 11:18:16AM +0800, Yunsheng Lin wrote:
> 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.
>
It's not really normal to limit ret scope... I think it's better to
leave it as-is.
regards,
dan carpenter
next prev parent reply other threads:[~2020-10-26 6:52 UTC|newest]
Thread overview: 8+ 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-23 11:22 ` Dan Carpenter
2020-10-26 3:18 ` Yunsheng Lin
2020-10-26 3:18 ` Yunsheng Lin
2020-10-26 6:52 ` Dan Carpenter [this message]
2020-10-26 6:52 ` Dan Carpenter
2020-10-26 23:17 ` Jakub Kicinski
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=20201026065235.GG18329@kadam \
--to=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=linyunsheng@huawei.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.