LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: CGEL <cgel.zte@gmail.com>
Cc: Jay Vosburgh <j.vosburgh@gmail.com>,
Veaceslav Falico <vfalico@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>,
"David S . Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Changcheng Deng <deng.changcheng@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] net: bonding: bond_alb: Replace if (cond) BUG() with BUG_ON()
Date: Mon, 30 Aug 2021 10:36:08 -0700 [thread overview]
Message-ID: <20210830103608.5e0394f1@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20210828010230.11022-1-deng.changcheng@zte.com.cn>
On Fri, 27 Aug 2021 18:02:30 -0700 CGEL wrote:
> From: Changcheng Deng <deng.changcheng@zte.com.cn>
>
> Fix the following coccinelle reports:
>
> ./drivers/net/bonding/bond_alb.c:976:3-6 WARNING: Use BUG_ON instead of
> if condition followed by BUG.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
> ---
> drivers/net/bonding/bond_alb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
> index 7d3752c..3288022 100644
> --- a/drivers/net/bonding/bond_alb.c
> +++ b/drivers/net/bonding/bond_alb.c
> @@ -972,8 +972,7 @@ static int alb_upper_dev_walk(struct net_device *upper,
> */
> if (netif_is_macvlan(upper) && !strict_match) {
> tags = bond_verify_device_path(bond->dev, upper, 0);
> - if (IS_ERR_OR_NULL(tags))
> - BUG();
> + BUG_ON(IS_ERR_OR_NULL(tags));
> alb_send_lp_vid(slave, upper->dev_addr,
> tags[0].vlan_proto, tags[0].vlan_id);
> kfree(tags);
The fact this code using is BUG() in the first place is more problematic
than not using BUG_ON(). Can it be converted to WARN_ON() + return?
Looks like alb_upper_dev_walk() returns int.
prev parent reply other threads:[~2021-08-30 17:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-28 1:02 CGEL
2021-08-30 17:36 ` Jakub Kicinski [this message]
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=20210830103608.5e0394f1@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
--to=kuba@kernel.org \
--cc=andy@greyhouse.net \
--cc=cgel.zte@gmail.com \
--cc=davem@davemloft.net \
--cc=deng.changcheng@zte.com.cn \
--cc=j.vosburgh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vfalico@gmail.com \
--cc=zealci@zte.com.cn \
--subject='Re: [PATCH linux-next] net: bonding: bond_alb: Replace if (cond) BUG() with BUG_ON()' \
/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
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).