* [PATCH] serial: sh-sci: Improve type-safety calling sci_receive_chars()
@ 2018-11-07 13:37 Geert Uytterhoeven
2018-11-08 3:05 ` Ulrich Hecht
2018-11-08 11:41 ` Simon Horman
0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2018-11-07 13:37 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby
Cc: Ulrich Hecht, Wolfram Sang, linux-serial, linux-renesas-soc,
Geert Uytterhoeven
While ptr and port both point to the uart_port structure, the former is
the untyped pointer cookie passed to interrupt handlers.
Use the correctly typed port variable instead, to improve type-safety.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/tty/serial/sh-sci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 8863689a6eebcc72..f1ee992532717a34 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1710,7 +1710,7 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr)
* of whether the I_IXOFF is set, otherwise, how is the interrupt
* to be disabled?
*/
- sci_receive_chars(ptr);
+ sci_receive_chars(port);
return IRQ_HANDLED;
}
@@ -1766,7 +1766,7 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr)
} else {
sci_handle_fifo_overrun(port);
if (!s->chan_rx)
- sci_receive_chars(ptr);
+ sci_receive_chars(port);
}
sci_clear_SCxSR(port, SCxSR_ERROR_CLEAR(port));
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] serial: sh-sci: Improve type-safety calling sci_receive_chars()
2018-11-07 13:37 [PATCH] serial: sh-sci: Improve type-safety calling sci_receive_chars() Geert Uytterhoeven
@ 2018-11-08 3:05 ` Ulrich Hecht
2018-11-08 11:41 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Ulrich Hecht @ 2018-11-08 3:05 UTC (permalink / raw)
To: Geert Uytterhoeven, Greg Kroah-Hartman, Jiri Slaby
Cc: Ulrich Hecht, Wolfram Sang, linux-serial, linux-renesas-soc
Thanks for your patch!
> On November 7, 2018 at 2:37 PM Geert Uytterhoeven <geert+renesas@glider.be> wrote:
>
>
> While ptr and port both point to the uart_port structure, the former is
> the untyped pointer cookie passed to interrupt handlers.
> Use the correctly typed port variable instead, to improve type-safety.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> drivers/tty/serial/sh-sci.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index 8863689a6eebcc72..f1ee992532717a34 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -1710,7 +1710,7 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr)
> * of whether the I_IXOFF is set, otherwise, how is the interrupt
> * to be disabled?
> */
> - sci_receive_chars(ptr);
> + sci_receive_chars(port);
>
> return IRQ_HANDLED;
> }
> @@ -1766,7 +1766,7 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr)
> } else {
> sci_handle_fifo_overrun(port);
> if (!s->chan_rx)
> - sci_receive_chars(ptr);
> + sci_receive_chars(port);
> }
>
> sci_clear_SCxSR(port, SCxSR_ERROR_CLEAR(port));
> --
> 2.17.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: Improve type-safety calling sci_receive_chars()
2018-11-07 13:37 [PATCH] serial: sh-sci: Improve type-safety calling sci_receive_chars() Geert Uytterhoeven
2018-11-08 3:05 ` Ulrich Hecht
@ 2018-11-08 11:41 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2018-11-08 11:41 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Greg Kroah-Hartman, Jiri Slaby, Ulrich Hecht, Wolfram Sang,
linux-serial, linux-renesas-soc
On Wed, Nov 07, 2018 at 02:37:31PM +0100, Geert Uytterhoeven wrote:
> While ptr and port both point to the uart_port structure, the former is
> the untyped pointer cookie passed to interrupt handlers.
> Use the correctly typed port variable instead, to improve type-safety.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-08 21:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-07 13:37 [PATCH] serial: sh-sci: Improve type-safety calling sci_receive_chars() Geert Uytterhoeven
2018-11-08 3:05 ` Ulrich Hecht
2018-11-08 11:41 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).