All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shevchenko, Andriy" <andriy.shevchenko@intel.com>
To: "alan@linux.intel.com" <alan@linux.intel.com>
Cc: "manabian@gmail.com" <manabian@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"blogic@openwrt.org" <blogic@openwrt.org>,
	"bigeasy@linutronix.de" <bigeasy@linutronix.de>,
	"alan@lxorguk.ukuu.org.uk" <alan@lxorguk.ukuu.org.uk>,
	"ricardo.ribalda@gmail.com" <ricardo.ribalda@gmail.com>,
	"yamada.masahiro@socionext.com" <yamada.masahiro@socionext.com>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jslaby@suse.cz" <jslaby@suse.cz>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"peter@hurleysoftware.com" <peter@hurleysoftware.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v6] serial: 8250_uniphier: add UniPhier serial driver
Date: Tue, 26 May 2015 15:08:27 +0000	[thread overview]
Message-ID: <1432652906.8736.44.camel@intel.com> (raw)
In-Reply-To: <1432650518.13900.72.camel@linux.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)


> 
> > > +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.

-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

WARNING: multiple messages have this Message-ID (diff)
From: andriy.shevchenko@intel.com (Shevchenko, Andriy)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6] serial: 8250_uniphier: add UniPhier serial driver
Date: Tue, 26 May 2015 15:08:27 +0000	[thread overview]
Message-ID: <1432652906.8736.44.camel@intel.com> (raw)
In-Reply-To: <1432650518.13900.72.camel@linux.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)


> 
> > > +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.

-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

WARNING: multiple messages have this Message-ID (diff)
From: "Shevchenko, Andriy" <andriy.shevchenko@intel.com>
To: "alan@linux.intel.com" <alan@linux.intel.com>
Cc: "manabian@gmail.com" <manabian@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"blogic@openwrt.org" <blogic@openwrt.org>,
	"bigeasy@linutronix.de" <bigeasy@linutronix.de>,
	"alan@lxorguk.ukuu.org.uk" <alan@lxorguk.ukuu.org.uk>,
	"ricardo.ribalda@gmail.com" <ricardo.ribalda@gmail.com>,
	"yamada.masahiro@socionext.com" <yamada.masahiro@socionext.com>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jslaby@suse.cz" <jslaby@suse.cz>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"peter@hurleysoftware.com" <peter@hurleysoftware.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v6] serial: 8250_uniphier: add UniPhier serial driver
Date: Tue, 26 May 2015 15:08:27 +0000	[thread overview]
Message-ID: <1432652906.8736.44.camel@intel.com> (raw)
In-Reply-To: <1432650518.13900.72.camel@linux.intel.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1835 bytes --]

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)


> 
> > > +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.

-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2015-05-26 15:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25  3:44 [PATCH v6] serial: 8250_uniphier: add UniPhier serial driver Masahiro Yamada
2015-05-25  3:44 ` Masahiro Yamada
2015-05-25  9:14 ` Shevchenko, Andriy
2015-05-25  9:14   ` Shevchenko, Andriy
2015-05-25  9:14   ` Shevchenko, Andriy
2015-05-25 10:12   ` Masahiro Yamada
2015-05-25 10:12     ` Masahiro Yamada
2015-05-26 14:28   ` Alan Cox
2015-05-26 14:28     ` Alan Cox
2015-05-26 15:08     ` Shevchenko, Andriy [this message]
2015-05-26 15:08       ` Shevchenko, Andriy
2015-05-26 15:08       ` Shevchenko, Andriy
2015-05-29  6:08       ` Masahiro Yamada
2015-05-29  6:08         ` Masahiro Yamada

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=1432652906.8736.44.camel@intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=alan@linux.intel.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bigeasy@linutronix.de \
    --cc=blogic@openwrt.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=manabian@gmail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=peter@hurleysoftware.com \
    --cc=ricardo.ribalda@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.