serial: sh-sci: Simplify multiplication/shift logic
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 21 Feb 2022 16:29:25 +0000 (17:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Feb 2022 18:48:01 +0000 (19:48 +0100)
"a * (1 << b)" == "a << b".

No change in generated code.

Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/118d62e167f6cf5e98bdf9a738634b4590ea8d09.1645460901.git.geert+renesas@glider.be
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sh-sci.c

index 968967d..77d7697 100644 (file)
@@ -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: