linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu OTHACEHE <m.othacehe@gmail.com>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: johan@kernel.org, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH 11/14] USB: serial: mos7840: move constants to right
Date: Mon, 1 Feb 2016 12:57:06 +0100	[thread overview]
Message-ID: <20160201115706.GA13635@gmail.com> (raw)
In-Reply-To: <87zivltovx.fsf@nemi.mork.no>

On Sun, Jan 31, 2016 at 10:33:54PM +0100, Bjørn Mork wrote:
> Mathieu OTHACEHE <m.othacehe@gmail.com> writes:
> 
> > This patch fixes the following coccinelle warnings:
> >
> > drivers/usb/serial/mos7840.c:2042:4-10: Move constant to right.
> > drivers/usb/serial/mos7840.c:2062:16-22: Move constant to right.
> >
> > Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com>
> > ---
> >  drivers/usb/serial/mos7840.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
> > index 8ddc313..982a3fb 100644
> > --- a/drivers/usb/serial/mos7840.c
> > +++ b/drivers/usb/serial/mos7840.c
> > @@ -2039,7 +2039,7 @@ static int mos7810_check(struct usb_serial *serial)
> >  		/* Send the 1-bit test pattern out to MCS7810 test pin */
> >  		usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
> >  			MCS_WRREQ, MCS_WR_RTYPE,
> > -			(0x0300 | (((test_pattern >> i) & 0x0001) << 1)),
> > +			((((test_pattern >> i) & 0x0001) << 1) | 0x0300),
> >  			MODEM_CONTROL_REGISTER, NULL, 0, MOS_WDR_TIMEOUT);
> >  
> >  		/* Read the test pattern back */
> > @@ -2059,7 +2059,7 @@ static int mos7810_check(struct usb_serial *serial)
> >  
> >  	/* Restore MCR setting */
> >  	usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), MCS_WRREQ,
> > -		MCS_WR_RTYPE, 0x0300 | mcr_data, MODEM_CONTROL_REGISTER, NULL,
> > +		MCS_WR_RTYPE, mcr_data | 0x0300, MODEM_CONTROL_REGISTER, NULL,
> >  		0, MOS_WDR_TIMEOUT);
> >  
> >  	kfree(buf);
> 
> I feel I'm missing something here, so I have to ask the stupid question:
> What could possibly be the benefit here?  Is it faster? Safer?  Easier
> to read?

I don't think it will be faster or safer, maybe easier to read. But the point is to remove the
warnings produced by the file scripts/coccinelle/misc/compare_const_fl.cocci when
running make coccicheck.

> 
> 
> 
> Bjørn

  reply	other threads:[~2016-02-01 11:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-30 17:44 [PATCH 00/14] USB: serial: Fix coccinelle warnings Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 01/14] USB: serial: safe_serial: fix assignment of bool to 0/1 Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 02/14] USB: serial: safe_serial: fix assignment of bool to non 0/1 constant Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 03/14] USB: serial: quatech2: remove comparison to bool Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 04/14] USB: serial: iuu_phoenix: remove comparison of bool Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 05/14] USB: serial: mos7840: remove comparison to bool Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 06/14] USB: serial: garmin_gps: move constants to right Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 07/14] USB: serial: ftdi_sio: " Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 08/14] USB: serial: keyspan: remove unused semicolon Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 09/14] USB: serial: cyberjack: remove unneeded variable Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 10/14] USB: serial: garmin_gps: " Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 11/14] USB: serial: mos7840: move constants to right Mathieu OTHACEHE
2016-01-31 21:33   ` Bjørn Mork
2016-02-01 11:57     ` Mathieu OTHACEHE [this message]
2016-02-01 12:37       ` Bjørn Mork
2016-02-28 12:46         ` Johan Hovold
2016-01-30 17:44 ` [PATCH 12/14] USB: serial: ch341: " Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 13/14] USB: serial: f81232: " Mathieu OTHACEHE
2016-01-30 17:44 ` [PATCH 14/14] USB: serial: kl5kusb105: remove unneeded semicolons Mathieu OTHACEHE
2016-01-31 20:10 ` [PATCH 00/14] USB: serial: Fix coccinelle warnings Johan Hovold

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=20160201115706.GA13635@gmail.com \
    --to=m.othacehe@gmail.com \
    --cc=bjorn@mork.no \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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;
as well as URLs for NNTP newsgroup(s).