[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <73337067-953c-55e2-986a-24116fb10544@rasmusvillemoes.dk>
Date: Thu, 14 Nov 2019 10:00:07 +0100
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Timur Tabi <timur@...nel.org>
Cc: Qiang Zhao <qiang.zhao@....com>, Li Yang <leoyang.li@....com>,
Christophe Leroy <christophe.leroy@....fr>,
linuxppc-dev@...ts.ozlabs.org,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
lkml <linux-kernel@...r.kernel.org>,
Scott Wood <oss@...error.net>, linux-serial@...r.kernel.org
Subject: Re: [PATCH v4 30/47] serial: ucc_uart: factor out soft_uart
initialization
On 14/11/2019 06.14, Timur Tabi wrote:
> On Fri, Nov 8, 2019 at 7:03 AM Rasmus Villemoes
> <linux@...musvillemoes.dk> wrote:
>>
>> - /*
>> - * Determine if we need Soft-UART mode
>> - */
>> if (of_find_property(np, "soft-uart", NULL)) {
>> dev_dbg(&ofdev->dev, "using Soft-UART mode\n");
>> soft_uart = 1;
>> + } else {
>> + return 0;
>> }
>
> How about:
>
> if (!of_find_property(np, "soft-uart", NULL))
> return 0;
of_property_read_bool() if anything. But I didn't want to do that kind
of transformation - just a pure "move this code out and fix the
indentation" with the minor edits needed to hook it back up where it
came from.
> And I think you should be able to get rid of the "soft_uart" variable.
Eh, no, it's used in several other places in the driver. I kind of hope
gcc is smart enough to see that in the !PPC32 case it is a static,
never-assigned-to, never-escapes variable so all the "if (soft_uart)"
branches go away, but that's not really very important.
Rasmus
Powered by blists - more mailing lists