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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux