All of lore.kernel.org
 help / color / mirror / Atom feed
From: khilman@baylibre.com (Kevin Hilman)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 1/6] serial: meson: fix setting number of stop bits
Date: Fri, 21 Apr 2017 15:03:45 -0700	[thread overview]
Message-ID: <m237d15sfy.fsf@baylibre.com> (raw)
In-Reply-To: <cbf6bc87-bea0-01e8-5f20-45734ff054d3@gmail.com> (Heiner Kallweit's message of "Mon, 17 Apr 2017 17:54:26 +0200")

Heiner Kallweit <hkallweit1@gmail.com> writes:

> Am 17.04.2017 um 17:24 schrieb Neil Armstrong:
>> On 04/16/2017 10:06 PM, Heiner Kallweit wrote:
>>> The stop bit value as to be or'ed, so far this worked only just by chance
>>> because AML_UART_STOP_BIN_1SB is 0.
>>>
>>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>>> ---
>>>  drivers/tty/serial/meson_uart.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
>>> index 60f16795..e2e25da1 100644
>>> --- a/drivers/tty/serial/meson_uart.c
>>> +++ b/drivers/tty/serial/meson_uart.c
>>> @@ -355,7 +355,7 @@ static void meson_uart_set_termios(struct uart_port *port,
>>>  	if (cflags & CSTOPB)
>>>  		val |= AML_UART_STOP_BIN_2SB;
>>>  	else
>>> -		val &= ~AML_UART_STOP_BIN_1SB;
>>> +		val |= AML_UART_STOP_BIN_1SB;
>>>  
>>>  	if (cflags & CRTSCTS)
>>>  		val &= ~AML_UART_TWO_WIRE_EN;
>>>
>> 
>> Hi,
>> 
>> in fact you can totally drop the else statement since it's a no-op in both cases.
>> 
> That's right. However I think leaving this in makes the code better understandable.
> And most likely the compiler will remove this no-op anyway.

Agreed.  I like it for readability.

Kevin

  reply	other threads:[~2017-04-21 22:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-16 20:02 [PATCH 0/6] serial: meson: series with smaller fixes and improvements Heiner Kallweit
2017-04-16 20:06 ` [PATCH 1/6] serial: meson: fix setting number of stop bits Heiner Kallweit
2017-04-17 15:24   ` Neil Armstrong
2017-04-17 15:54     ` Heiner Kallweit
2017-04-21 22:03       ` Kevin Hilman [this message]
2017-04-16 20:10 ` [PATCH 2/6] serial: meson: remove dead code in meson_uart_change_speed Heiner Kallweit
2017-04-17 15:25   ` Neil Armstrong
2017-04-17 15:54     ` Andreas Färber
2017-04-16 20:13 ` [PATCH 3/6] serial: meson: remove unneeded variable assignment in meson_serial_port_write Heiner Kallweit
2017-04-17 13:58   ` Ben Dooks
2017-04-17 15:27     ` Neil Armstrong
2017-04-17 15:37       ` Andreas Färber
2017-04-17 16:03         ` Heiner Kallweit
2017-04-19  8:39         ` Neil Armstrong
2017-04-16 20:15 ` [PATCH 4/6] serial: meson: make use of uart_port member mapsize Heiner Kallweit
2017-04-17 13:53   ` Ben Dooks
2017-04-17 15:28   ` Neil Armstrong
2017-04-16 20:21 ` [PATCH 5/6] serial: meson: remove use of flag UPF_IOREMAP Heiner Kallweit
2017-04-17 15:28   ` Neil Armstrong
2017-04-16 20:23 ` [PATCH 6/6] serial: meson: change interrupt description to of node name Heiner Kallweit
2017-04-17 13:52   ` Ben Dooks
2017-04-17 15:29   ` Neil Armstrong

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=m237d15sfy.fsf@baylibre.com \
    --to=khilman@baylibre.com \
    --cc=linus-amlogic@lists.infradead.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 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.