Re: [PATCH] serial: sh-sci: Simplify multiplication/shift logic

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

 



> On 02/21/2022 5:29 PM Geert Uytterhoeven <geert+renesas@xxxxxxxxx> wrote:
> 
>  
> "a * (1 << b)" == "a << b".
> 
> No change in generated code.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> ---
>  drivers/tty/serial/sh-sci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index 968967d722d494c2..77d76973858f7d7f 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -2293,7 +2293,7 @@ static int sci_scbrr_calc(struct sci_port *s, unsigned int bps,
>  	for_each_sr(sr, s) {
>  		for (c = 0; c <= 3; c++) {
>  			/* integerized formulas from HSCIF documentation */
> -			prediv = sr * (1 << (2 * c + 1));
> +			prediv = sr << (2 * c + 1);
>  
>  			/*
>  			 * We need to calculate:
> -- 
> 2.25.1

Reviewed-by: Ulrich Hecht <uli+renesas@xxxxxxxx>

CU
Uli



[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