From: David Miller <davem@davemloft.net>
To: niklas.cassel@axis.com
Cc: peppe.cavallaro@st.com, alexandre.torgue@st.com,
niklass@axis.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: stmmac: do not use a bitwise AND operator with a bool operand
Date: Wed, 24 Jan 2018 16:28:31 -0500 (EST) [thread overview]
Message-ID: <20180124.162831.1299884714527054383.davem@davemloft.net> (raw)
In-Reply-To: <20180122155950.3527-1-niklas.cassel@axis.com>
From: Niklas Cassel <niklas.cassel@axis.com>
Date: Mon, 22 Jan 2018 16:59:50 +0100
> Doing a bitwise AND between a bool and an int is generally not a good idea.
> The bool will be promoted to an int with value 0 or 1,
> the int is generally regarded as true with a non-zero value,
> thus ANDing them has the potential to yield an undesired result.
>
> This commit fixes the following smatch warnings:
>
> drivers/net/ethernet/stmicro/stmmac/enh_desc.c:344 enh_desc_prepare_tx_desc() warn: maybe use && instead of &
> drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c:337 dwmac4_rd_prepare_tx_desc() warn: maybe use && instead of &
> drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c:380 dwmac4_rd_prepare_tso_tx_desc() warn: maybe use && instead of &
>
> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Applied.
prev parent reply other threads:[~2018-01-24 21:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-22 15:59 [PATCH net-next] net: stmmac: do not use a bitwise AND operator with a bool operand Niklas Cassel
2018-01-24 21:28 ` David Miller [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=20180124.162831.1299884714527054383.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=alexandre.torgue@st.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=niklas.cassel@axis.com \
--cc=niklass@axis.com \
--cc=peppe.cavallaro@st.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).