[PATCH] serial: sh-sci: Add missing header guard

Prabhakar posted 1 patch 1 week, 1 day ago
drivers/tty/serial/sh-sci.h | 5 +++++
1 file changed, 5 insertions(+)
[PATCH] serial: sh-sci: Add missing header guard
Posted by Prabhakar 1 week, 1 day ago
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Add header guard to sh-sci.h to prevent multiple inclusions of the
header file.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/tty/serial/sh-sci.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
index 951681aba586..22f877e2a17e 100644
--- a/drivers/tty/serial/sh-sci.h
+++ b/drivers/tty/serial/sh-sci.h
@@ -1,4 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __SH_SCI_H__
+#define __SH_SCI_H__
+
 #include <linux/bitops.h>
 #include <linux/serial_core.h>
 #include <linux/io.h>
@@ -176,3 +179,5 @@ enum {
 	(((port)->type == PORT_SCI) ? SCI_TDxE_CLEAR : SCIF_TDxE_CLEAR)
 #define SCxSR_BREAK_CLEAR(port) \
 	(((port)->type == PORT_SCI) ? SCI_BREAK_CLEAR : SCIF_BREAK_CLEAR)
+
+#endif /* __SH_SCI_H__ */
-- 
2.51.0
Re: [PATCH] serial: sh-sci: Add missing header guard
Posted by Greg Kroah-Hartman 1 week, 1 day ago
On Tue, Sep 23, 2025 at 10:28:46AM +0100, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> 
> Add header guard to sh-sci.h to prevent multiple inclusions of the
> header file.
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
>  drivers/tty/serial/sh-sci.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
> index 951681aba586..22f877e2a17e 100644
> --- a/drivers/tty/serial/sh-sci.h

Why is this a .h file at all?  It's so small, why not just put it all in
the .c file and then there's no need for it anymore.

thanks,

greg k-h
Re: [PATCH] serial: sh-sci: Add missing header guard
Posted by Geert Uytterhoeven 1 week, 1 day ago
Hi Greg,

On Tue, 23 Sept 2025 at 11:51, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Tue, Sep 23, 2025 at 10:28:46AM +0100, Prabhakar wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> >
> > Add header guard to sh-sci.h to prevent multiple inclusions of the
> > header file.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > ---
> >  drivers/tty/serial/sh-sci.h | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
> > index 951681aba586..22f877e2a17e 100644
> > --- a/drivers/tty/serial/sh-sci.h
>
> Why is this a .h file at all?  It's so small, why not just put it all in
> the .c file and then there's no need for it anymore.

Until commit e76fe57447e88916 ("sh: Remove old early serial console code
V2") in v2.6.33, it was also included by arch/sh/kernel/early_printk.c.
Those days are long gone, so the time has come for assimilation...

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Re: [PATCH] serial: sh-sci: Add missing header guard
Posted by Lad, Prabhakar 1 week, 1 day ago
Hi Geert,

On Tue, Sep 23, 2025 at 10:59 AM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
>
> Hi Greg,
>
> On Tue, 23 Sept 2025 at 11:51, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > On Tue, Sep 23, 2025 at 10:28:46AM +0100, Prabhakar wrote:
> > > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > >
> > > Add header guard to sh-sci.h to prevent multiple inclusions of the
> > > header file.
> > >
> > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > > ---
> > >  drivers/tty/serial/sh-sci.h | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > >
> > > diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h
> > > index 951681aba586..22f877e2a17e 100644
> > > --- a/drivers/tty/serial/sh-sci.h
> >
> > Why is this a .h file at all?  It's so small, why not just put it all in
> > the .c file and then there's no need for it anymore.
>
> Until commit e76fe57447e88916 ("sh: Remove old early serial console code
> V2") in v2.6.33, it was also included by arch/sh/kernel/early_printk.c.
> Those days are long gone, so the time has come for assimilation...
>
You beat me. I was about to ask if you are OK moving this to `sh-sci.c`.

I'll drop this patch and merge the sh-sci.h header into sh-sci.c.

Cheers,
Prabhakar