lkml.org 
[lkml]   [2015]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v6] serial: 8250_uniphier: add UniPhier serial driver
From
2015-05-27 0:08 GMT+09:00 Shevchenko, Andriy <andriy.shevchenko@intel.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


\
 
 \ /
  Last update: 2015-05-29 08:41    [W:0.045 / U:9.608 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site