From: Wolfram Sang <wsa@the-dreams.de>
To: Nickolaus Woodruff <nickolauswoodruff@gmail.com>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/i2c/i2c-core.c: Fix sparse warning
Date: Fri, 3 Apr 2015 20:28:23 +0200 [thread overview]
Message-ID: <20150403182822.GC1298@katana> (raw)
In-Reply-To: <20150403025338.GA18595@Caladan>
[-- Attachment #1: Type: text/plain, Size: 192 bytes --]
> - u8 addr = (msg->addr << 1) | !!(msg->flags & I2C_M_RD);
> + u8 addr = (msg->addr << 1) | ((msg->flags & I2C_M_RD) != 0);
I prefer !! as an idiom for "bit to bool".
Thanks,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-04-03 18:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-03 2:53 [PATCH] drivers/i2c/i2c-core.c: Fix sparse warning Nickolaus Woodruff
2015-04-03 18:28 ` Wolfram Sang [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=20150403182822.GC1298@katana \
--to=wsa@the-dreams.de \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nickolauswoodruff@gmail.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