Re: [PATCH v2 5/5] tty: serial: amba-pl011: unindent pl011_console_get_options function body

From: Ilpo Järvinen
Date: Thu Nov 16 2023 - 06:59:15 EST


On Thu, 16 Nov 2023, Théo Lebrun wrote:

> The whole function body is encapsulated inside an if-condition. Reverse
> the if logic and early return to remove one indentation level.
>
> Also turn two nested ifs into a single one at the end of the function.
>
> Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> Signed-off-by: Théo Lebrun <theo.lebrun@xxxxxxxxxxx>
> ---
>

> - if (uap->vendor->oversampling) {
> - if (pl011_read(uap, REG_CR)
> - & ST_UART011_CR_OVSFACT)
> - *baud *= 2;
> - }
> + if (uap->vendor->oversampling &&
> + (pl011_read(uap, REG_CR) & ST_UART011_CR_OVSFACT)) {
> + *baud *= 2;
> }
> }

Braces are no longer necessary for this block.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>

--
i.