From: "M. Asselstine" <asselsm@mcmaster.ca>
To: "Julia Lawall" <julia@diku.dk>
Cc: ben-linux@fluff.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/2] drivers/i2c/busses/i2c-s3c2410.c: Correct use of ! and &
Date: Sun, 5 Oct 2008 21:20:49 -0400 [thread overview]
Message-ID: <919fe2b30810051820w29df40d0ued4e15d740674a29@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0810042203520.19286@ask.diku.dk>
On Sat, Oct 4, 2008 at 4:05 PM, Julia Lawall <julia@diku.dk> wrote:
> From: Julia Lawall <julia@diku.dk>
>
> In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337, a bug was fixed that
> involved converting !x & y to !(x & y). The code below shows the same
> pattern, and thus should perhaps be fixed in the same way. In particular,
> the result of !readl(i2c->regs + S3C2410_IICCON) & S3C2410_IICCON_IRQEN is
> always 0.
>
> The semantic patch that makes this change is as follows:
> (http://www.emn.fr/x-info/coccinelle/)
>
> // <smpl>
> @@ expression E; constant C; @@
> (
> !E & !C
> |
> - !E & C
> + !(E & C)
> )
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
Reviewed-by: Mark Asselstine <mark.asselstine@windriver.com>
Good catch Julia.
>
> ---
> drivers/i2c/busses/i2c-s3c2410.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -u -p a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -507,7 +507,7 @@ static int s3c24xx_i2c_doxfer(struct s3c
> unsigned long timeout;
> int ret;
>
> - if (!readl(i2c->regs + S3C2410_IICCON) & S3C2410_IICCON_IRQEN)
> + if (!(readl(i2c->regs + S3C2410_IICCON) & S3C2410_IICCON_IRQEN))
> return -EIO;
>
> ret = s3c24xx_i2c_set_master(i2c);
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
prev parent reply other threads:[~2008-10-06 1:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-04 20:05 Julia Lawall
2008-10-06 1:20 ` M. Asselstine [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=919fe2b30810051820w29df40d0ued4e15d740674a29@mail.gmail.com \
--to=asselsm@mcmaster.ca \
--cc=ben-linux@fluff.org \
--cc=julia@diku.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®