* [PATCH] serial: sh-sci: Simplify multiplication/shift logic
@ 2022-02-21 16:29 Geert Uytterhoeven
2022-02-21 16:50 ` Ulrich Hecht
2022-03-01 14:50 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2022-02-21 16:29 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Wolfram Sang, Ulrich Hecht
Cc: linux-serial, linux-renesas-soc, Geert Uytterhoeven
"a * (1 << b)" == "a << b".
No change in generated code.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] serial: sh-sci: Simplify multiplication/shift logic
2022-02-21 16:29 [PATCH] serial: sh-sci: Simplify multiplication/shift logic Geert Uytterhoeven
@ 2022-02-21 16:50 ` Ulrich Hecht
2022-03-01 14:50 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Ulrich Hecht @ 2022-02-21 16:50 UTC (permalink / raw)
To: Geert Uytterhoeven, Greg Kroah-Hartman, Jiri Slaby, Wolfram Sang,
Ulrich Hecht
Cc: linux-serial, linux-renesas-soc
> On 02/21/2022 5:29 PM Geert Uytterhoeven <geert+renesas@glider.be> wrote:
>
>
> "a * (1 << b)" == "a << b".
>
> No change in generated code.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> 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@fpond.eu>
CU
Uli
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] serial: sh-sci: Simplify multiplication/shift logic
2022-02-21 16:29 [PATCH] serial: sh-sci: Simplify multiplication/shift logic Geert Uytterhoeven
2022-02-21 16:50 ` Ulrich Hecht
@ 2022-03-01 14:50 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2022-03-01 14:50 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Greg Kroah-Hartman, Jiri Slaby, Ulrich Hecht, linux-serial,
linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 269 bytes --]
On Mon, Feb 21, 2022 at 05:29:25PM +0100, Geert Uytterhoeven wrote:
> "a * (1 << b)" == "a << b".
>
> No change in generated code.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-01 14:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-21 16:29 [PATCH] serial: sh-sci: Simplify multiplication/shift logic Geert Uytterhoeven
2022-02-21 16:50 ` Ulrich Hecht
2022-03-01 14:50 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox