From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antti Palosaari Date: Sun, 26 Aug 2012 16:21:24 +0000 Subject: Re: [PATCH] drivers/media/dvb-frontends/rtl2830.c: correct double assignment Message-Id: <503A4D04.2050303@iki.fi> List-Id: References: <1345997751-340-1-git-send-email-Julia.Lawall@lip6.fr> In-Reply-To: <1345997751-340-1-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Julia Lawall Cc: Mauro Carvalho Chehab , kernel-janitors@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, awalls@md.metrocast.net On 08/26/2012 07:15 PM, Julia Lawall wrote: > From: Julia Lawall > > 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/) > > // > @@ > expression i; > @@ > > *i = ...; > i = ...; > // > > Signed-off-by: Julia Lawall > > --- > 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 Reviewed-by: Antti Palosaari Antti -- http://palosaari.fi/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]:60963 "EHLO mail-lpp01m010-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751114Ab2HZQWM (ORCPT ); Sun, 26 Aug 2012 12:22:12 -0400 Message-ID: <503A4D04.2050303@iki.fi> Date: Sun, 26 Aug 2012 19:21:24 +0300 From: Antti Palosaari MIME-Version: 1.0 To: Julia Lawall CC: Mauro Carvalho Chehab , 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 References: <1345997751-340-1-git-send-email-Julia.Lawall@lip6.fr> In-Reply-To: <1345997751-340-1-git-send-email-Julia.Lawall@lip6.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: On 08/26/2012 07:15 PM, Julia Lawall wrote: > From: Julia Lawall > > 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/) > > // > @@ > expression i; > @@ > > *i = ...; > i = ...; > // > > Signed-off-by: Julia Lawall > > --- > 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 Reviewed-by: Antti Palosaari Antti -- http://palosaari.fi/