From: Nickolaus Woodruff <nickolauswoodruff@gmail.com>
To: wsa@the-dreams.de
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] drivers/i2c/i2c-core.c: Fix sparse warning
Date: Thu, 2 Apr 2015 22:53:38 -0400 [thread overview]
Message-ID: <20150403025338.GA18595@Caladan> (raw)
This patch fixes the following sparse warning in drivers/i2c/:
CHECK drivers/i2c/i2c-core.c
drivers/i2c/i2c-core.c:2353:36: warning: dubious: x | !y
Signed-off-by: Nickolaus Woodruff <nickolauswoodruff@gmail.com>
---
drivers/i2c/i2c-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index edf274c..f50d46e 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -2350,7 +2350,7 @@ static u8 i2c_smbus_pec(u8 crc, u8 *p, size_t count)
static u8 i2c_smbus_msg_pec(u8 pec, struct i2c_msg *msg)
{
/* The address will be sent first */
- u8 addr = (msg->addr << 1) | !!(msg->flags & I2C_M_RD);
+ u8 addr = (msg->addr << 1) | ((msg->flags & I2C_M_RD) != 0);
pec = i2c_smbus_pec(pec, &addr, 1);
/* The data buffer follows */
--
1.9.1
next reply other threads:[~2015-04-03 2:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-03 2:53 Nickolaus Woodruff [this message]
2015-04-03 18:28 ` [PATCH] drivers/i2c/i2c-core.c: Fix sparse warning Wolfram Sang
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=20150403025338.GA18595@Caladan \
--to=nickolauswoodruff@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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