lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNAQ6Q9OzTT0NN-uruGQhhXzt9d_n7gogXTtPYgH8PnzRrg@mail.gmail.com>
Date:	Fri, 29 May 2015 15:08:39 +0900
From:	Masahiro Yamada <yamada.masahiro@...ionext.com>
To:	"Shevchenko, Andriy" <andriy.shevchenko@...el.com>
Cc:	"alan@...ux.intel.com" <alan@...ux.intel.com>,
	"peter@...leysoftware.com" <peter@...leysoftware.com>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"manabian@...il.com" <manabian@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
	"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
	"ricardo.ribalda@...il.com" <ricardo.ribalda@...il.com>,
	"jslaby@...e.cz" <jslaby@...e.cz>,
	"bigeasy@...utronix.de" <bigeasy@...utronix.de>,
	"alan@...rguk.ukuu.org.uk" <alan@...rguk.ukuu.org.uk>,
	"blogic@...nwrt.org" <blogic@...nwrt.org>
Subject: Re: [PATCH v6] serial: 8250_uniphier: add UniPhier serial driver

2015-05-27 0:08 GMT+09:00 Shevchenko, Andriy <andriy.shevchenko@...el.com>:
> On Tue, 2015-05-26 at 15:28 +0100, Alan Cox wrote:
>> > > +
>> > > +#define UNIPHIER_UART_CHAR_FCR   3       /* Character / FIFO Control Register */
>> > > +#define UNIPHIER_UART_LCR_MCR    4       /* Line/Modem Control Register */
>> > > +#define   UNIPHIER_UART_LCR_SHIFT        8
>> >
>> > Indentation problem, needs to be fixed.
>>
>> If you are going to review a patch set at least look at the previous
>> reviews - the indentation was already discussed and is done that way to
>> show (as many drivers do) which are fields for which registers
>
> This is not exactly the field, the way how to get the field.
> In some cases it is even better to define something like
> _LCR(x)  ((x) << 8)


I want to shift the value for both read and write,
so I think LCR_SHIFT is handier than _LCR(x).

I think the indentation here is OK as it is.



>>
>> > > +static unsigned int uniphier_serial_in(struct uart_port *p, int offset)
>> > > +{
>> > > + int valshift = 0;
>> >
>> > Perhaps unsigned int?
>>
>> Why ? even if it mattered gcc is already realising that the value can
>> only be 0 or 8 and will be generating whatever works best for that.
>
> It's not about how gcc does, it's about what assumptions can be made
> from the reading of the source code. I think if we do a counter of shift
> value it would be nice to set an unsigned type explicitly.

int should work enough, but just in case, I added unsigned in v7.


-- 
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ