From: Antti Palosaari <crope@iki.fi>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
kernel-janitors@vger.kernel.org, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org, awalls@md.metrocast.net
Subject: Re: [PATCH] drivers/media/dvb-frontends/rtl2830.c: correct double assignment
Date: Sun, 26 Aug 2012 19:21:24 +0300 [thread overview]
Message-ID: <503A4D04.2050303@iki.fi> (raw)
In-Reply-To: <1345997751-340-1-git-send-email-Julia.Lawall@lip6.fr>
On 08/26/2012 07:15 PM, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> The double assignment is meant to be a bit-or to combine two values.
>
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression i;
> @@
>
> *i = ...;
> i = ...;
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> drivers/media/dvb-frontends/rtl2830.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/dvb-frontends/rtl2830.c b/drivers/media/dvb-frontends/rtl2830.c
> index 8fa8b08..b6ab858 100644
> --- a/drivers/media/dvb-frontends/rtl2830.c
> +++ b/drivers/media/dvb-frontends/rtl2830.c
> @@ -254,7 +254,7 @@ static int rtl2830_init(struct dvb_frontend *fe)
> goto err;
>
> buf[0] = tmp << 6;
> - buf[0] = (if_ctl >> 16) & 0x3f;
> + buf[0] |= (if_ctl >> 16) & 0x3f;
> buf[1] = (if_ctl >> 8) & 0xff;
> buf[2] = (if_ctl >> 0) & 0xff;
>
>
Thank you!
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Antti
--
http://palosaari.fi/
prev parent reply other threads:[~2012-08-26 16:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-26 16:15 [PATCH] drivers/media/dvb-frontends/rtl2830.c: correct double assignment Julia Lawall
2012-08-26 16:21 ` Antti Palosaari [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=503A4D04.2050303@iki.fi \
--to=crope@iki.fi \
--cc=Julia.Lawall@lip6.fr \
--cc=awalls@md.metrocast.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.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;
as well as URLs for NNTP newsgroup(s).