Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: John Crispin <blogic@openwrt.org>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	John Crispin <john@phrozen.org>,
	Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH V2 4/9] arch: mips: ralink: add tty detection
Date: Thu, 5 Nov 2015 18:26:42 +0100	[thread overview]
Message-ID: <563B9152.3050906@openwrt.org> (raw)
In-Reply-To: <563B902B.3060702@cogentembedded.com>



On 05/11/2015 18:21, Sergei Shtylyov wrote:
> On 11/05/2015 05:27 PM, John Crispin wrote:
> 
>>>> MT7688 has several uarts that can be used for console. There are
>>>> several
>>>> boards in the wild, that use ttyS1 or ttyS2. This patch applies a
>>>> simply
>>>> autodetection routine to figure out which ttyS the bootloader used as
>>>> console. The uarts come up in 6 bit mode by default. The bootloader
>>>> will
>>>> have set 8 bit mode on the console. Find that 8bit tty and use it.
>>>>
>>>> Signed-off-by: John Crispin <blogic@openwrt.org>
>>>> ---
>>>> Changes in V2:
>>>> * remove superflous inline definition
>>>>
>>>>    arch/mips/ralink/early_printk.c |   26 ++++++++++++++++++++++++++
>>>>    1 file changed, 26 insertions(+)
>>>>
>>>> diff --git a/arch/mips/ralink/early_printk.c
>>>> b/arch/mips/ralink/early_printk.c
>>>> index 255d695..3c59ffe 100644
>>>> --- a/arch/mips/ralink/early_printk.c
>>>> +++ b/arch/mips/ralink/early_printk.c
>>> [...]
>>>> @@ -47,8 +49,32 @@ static inline int soc_is_mt7628(void)
>>>>            (__raw_readl(chipid_membase) == MT7628_CHIP_NAME1);
>>>>    }
>>>>
>>>> +static void find_uart_base(void)
>>>> +{
>>>> +    int i;
>>>> +
>>>> +    if (!soc_is_mt7628())
>>>> +        return;
>>>> +
>>>> +    for (i = 0; i < 3; i++) {
>>>> +        u32 reg = uart_r32(UART_REG_LCR + (0x100 * i));
>>>
>>>     Inner parens not needed, the operator precedence is natural.
>>>
>>
>> "not needed" means "should be removed" or "not needed".
> 
>    That's completely up to you.
> 
>> checkpatch.pl certainly did not complain and a quick look around
>> instantly yielded lots of places in the kernel where this is done. imho
>> the brackets make it more readable
> 
>    Do you really always write 2 + (3 * 4) when you e.g. use scientific
> calculator?

no that would be silly. when using a calculator i know what i am typing.
unless there is someone looking over my shoulder i am the only one that
needs to understand.

when i write software that others are supposed to read which has
"register + (bank * bank offset)" constructs in it then i tend to add
brackets.

	John

> 
> [...]
> 
> MBR, Sergei

      reply	other threads:[~2015-11-05 17:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-05  2:59 [PATCH V2 4/9] arch: mips: ralink: add tty detection John Crispin
2015-11-05 14:07 ` Sergei Shtylyov
2015-11-05 14:27   ` John Crispin
2015-11-05 17:21     ` Sergei Shtylyov
2015-11-05 17:26       ` John Crispin [this message]

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=563B9152.3050906@openwrt.org \
    --to=blogic@openwrt.org \
    --cc=john@phrozen.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=sergei.shtylyov@cogentembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox