From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753860AbcBAL5M (ORCPT ); Mon, 1 Feb 2016 06:57:12 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33279 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752644AbcBAL5K (ORCPT ); Mon, 1 Feb 2016 06:57:10 -0500 Date: Mon, 1 Feb 2016 12:57:06 +0100 From: Mathieu OTHACEHE To: =?iso-8859-1?Q?Bj=F8rn?= Mork 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 Message-ID: <20160201115706.GA13635@gmail.com> References: <1454175887-16158-1-git-send-email-m.othacehe@gmail.com> <1454175887-16158-12-git-send-email-m.othacehe@gmail.com> <87zivltovx.fsf@nemi.mork.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87zivltovx.fsf@nemi.mork.no> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 31, 2016 at 10:33:54PM +0100, Bjørn Mork wrote: > Mathieu OTHACEHE 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 > > --- > > 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