2023-07-26 15:04:14

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] csky: fix old style declaration in module.c

From: Arnd Bergmann <[email protected]>

With W=1, gcc warns about the inline keyword in the wrong place:

arch/csky/kernel/module.c:43:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]

Signed-off-by: Arnd Bergmann <[email protected]>
---
arch/csky/kernel/module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/csky/kernel/module.c b/arch/csky/kernel/module.c
index f11b3e5733448..0b56a8cd12a3d 100644
--- a/arch/csky/kernel/module.c
+++ b/arch/csky/kernel/module.c
@@ -40,7 +40,7 @@ static void jsri_2_lrw_jsr(uint32_t *location)
}
}
#else
-static void inline jsri_2_lrw_jsr(uint32_t *location)
+static inline void jsri_2_lrw_jsr(uint32_t *location)
{
return;
}
--
2.39.2



2023-07-29 07:54:24

by Guo Ren

[permalink] [raw]
Subject: Re: [PATCH] csky: fix old style declaration in module.c

Thx Arnd,

Reviewed-by: Guo Ren <[email protected]>

You could directly put it in your next tree. If you need me to do
that, please don't hesitate to let me know.

On Wed, Jul 26, 2023 at 10:57 PM Arnd Bergmann <[email protected]> wrote:
>
> From: Arnd Bergmann <[email protected]>
>
> With W=1, gcc warns about the inline keyword in the wrong place:
>
> arch/csky/kernel/module.c:43:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> arch/csky/kernel/module.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/csky/kernel/module.c b/arch/csky/kernel/module.c
> index f11b3e5733448..0b56a8cd12a3d 100644
> --- a/arch/csky/kernel/module.c
> +++ b/arch/csky/kernel/module.c
> @@ -40,7 +40,7 @@ static void jsri_2_lrw_jsr(uint32_t *location)
> }
> }
> #else
> -static void inline jsri_2_lrw_jsr(uint32_t *location)
> +static inline void jsri_2_lrw_jsr(uint32_t *location)
> {
> return;
> }
> --
> 2.39.2
>


--
Best Regards
Guo Ren

2023-07-29 07:56:33

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] csky: fix old style declaration in module.c

On Sat, Jul 29, 2023, at 06:59, Guo Ren wrote:
> Thx Arnd,
>
> Reviewed-by: Guo Ren <[email protected]>
>
> You could directly put it in your next tree. If you need me to do
> that, please don't hesitate to let me know.

I don't currently plan to send a pull request for the warning
fixes, please just merge it through your own tree for 6.5 or
6.6.

I'd like to enable a few warning options (-Wextra, -Wrestrict,
-Wmissing-prototypes, ...) in the Kbuild for 6.6, but the Makefile
changes will probably go through the Kbuild tree or linux-mm,
and the fixes for existing warnings can just take their normal way.

Arnd

2023-07-29 09:27:35

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] csky: fix old style declaration in module.c

On Sat, Jul 29, 2023, at 09:06, Arnd Bergmann wrote:
> On Sat, Jul 29, 2023, at 06:59, Guo Ren wrote:

> I'd like to enable a few warning options (-Wextra, -Wrestrict,
> -Wmissing-prototypes, ...) in the Kbuild for 6.6, but the Makefile
> changes will probably go through the Kbuild tree or linux-mm,
> and the fixes for existing warnings can just take their normal way.

I just checked my log files again and I now see that there
are actually a number of -Wmissing-prototype warnings as well:

csky/kernel/signal.c:255:17: error: no previous prototype for 'do_notify_resume' [-Werror=missing-prototypes]
csky/mm/fault.c:187:17: error: no previous prototype for 'do_page_fault' [-Werror=missing-prototypes]
csky/kernel/traps.c:57:13: error: no previous prototype for 'trap_init' [-Werror=missing-prototypes]
csky/kernel/traps.c:150:15: error: no previous prototype for 'do_trap_unknown' [-Werror=missing-prototypes]
csky/kernel/traps.c:152:15: error: no previous prototype for 'do_trap_zdiv' [-Werror=missing-prototypes]
csky/kernel/traps.c:154:15: error: no previous prototype for 'do_trap_buserr' [-Werror=missing-prototypes]
csky/kernel/traps.c:157:17: error: no previous prototype for 'do_trap_misaligned' [-Werror=missing-prototypes]
csky/kernel/traps.c:168:17: error: no previous prototype for 'do_trap_bkpt' [-Werror=missing-prototypes]
csky/kernel/traps.c:187:17: error: no previous prototype for 'do_trap_illinsn' [-Werror=missing-prototypes]
csky/kernel/traps.c:210:17: error: no previous prototype for 'do_trap_fpe' [-Werror=missing-prototypes]
csky/kernel/traps.c:220:17: error: no previous prototype for 'do_trap_priv' [-Werror=missing-prototypes]
csky/kernel/traps.c:230:17: error: no previous prototype for 'trap_c' [-Werror=missing-prototypes]
csky/kernel/vdso/vgettimeofday.c:6:5: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes]
csky/kernel/vdso/vgettimeofday.c:12:5: error: no previous prototype for '__vdso_clock_gettime64' [-Werror=missing-prototypes]
csky/kernel/vdso/vgettimeofday.c:18:5: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes]
csky/kernel/vdso/vgettimeofday.c:24:5: error: no previous prototype for '__vdso_clock_getres' [-Werror=missing-prototypes]
csky/kernel/setup.c:104:34: error: no previous prototype for 'csky_start' [-Werror=missing-prototypes]
csky/kernel/ptrace.c:320:16: error: no previous prototype for 'syscall_trace_enter' [-Werror=missing-prototypes]
csky/kernel/ptrace.c:336:17: error: no previous prototype for 'syscall_trace_exit' [-Werror=missing-prototypes]

I missed these as I was first looking at everything except
-Wmissing-prototypes that I want to enable. Can you perhaps
help out and create a fix for these yourself?

Arnd

2023-07-30 01:04:30

by Guo Ren

[permalink] [raw]
Subject: Re: [PATCH] csky: fix old style declaration in module.c

On Sat, Jul 29, 2023 at 3:06 AM Arnd Bergmann <[email protected]> wrote:
>
> On Sat, Jul 29, 2023, at 06:59, Guo Ren wrote:
> > Thx Arnd,
> >
> > Reviewed-by: Guo Ren <[email protected]>
> >
> > You could directly put it in your next tree. If you need me to do
> > that, please don't hesitate to let me know.
>
> I don't currently plan to send a pull request for the warning
> fixes, please just merge it through your own tree for 6.5 or
> 6.6.
>
> I'd like to enable a few warning options (-Wextra, -Wrestrict,
> -Wmissing-prototypes, ...) in the Kbuild for 6.6, but the Makefile
> changes will probably go through the Kbuild tree or linux-mm,
> and the fixes for existing warnings can just take their normal way.
Okay, I would put it in my tree.

>
> Arnd



--
Best Regards
Guo Ren

2023-07-30 01:06:15

by Guo Ren

[permalink] [raw]
Subject: Re: [PATCH] csky: fix old style declaration in module.c

On Sat, Jul 29, 2023 at 4:05 AM Arnd Bergmann <[email protected]> wrote:
>
> On Sat, Jul 29, 2023, at 09:06, Arnd Bergmann wrote:
> > On Sat, Jul 29, 2023, at 06:59, Guo Ren wrote:
>
> > I'd like to enable a few warning options (-Wextra, -Wrestrict,
> > -Wmissing-prototypes, ...) in the Kbuild for 6.6, but the Makefile
> > changes will probably go through the Kbuild tree or linux-mm,
> > and the fixes for existing warnings can just take their normal way.
>
> I just checked my log files again and I now see that there
> are actually a number of -Wcc warnings as well:
>
> csky/kernel/signal.c:255:17: error: no previous prototype for 'do_notify_resume' [-Werror=missing-prototypes]
> csky/mm/fault.c:187:17: error: no previous prototype for 'do_page_fault' [-Werror=missing-prototypes]
> csky/kernel/traps.c:57:13: error: no previous prototype for 'trap_init' [-Werror=missing-prototypes]
> csky/kernel/traps.c:150:15: error: no previous prototype for 'do_trap_unknown' [-Werror=missing-prototypes]
> csky/kernel/traps.c:152:15: error: no previous prototype for 'do_trap_zdiv' [-Werror=missing-prototypes]
> csky/kernel/traps.c:154:15: error: no previous prototype for 'do_trap_buserr' [-Werror=missing-prototypes]
> csky/kernel/traps.c:157:17: error: no previous prototype for 'do_trap_misaligned' [-Werror=missing-prototypes]
> csky/kernel/traps.c:168:17: error: no previous prototype for 'do_trap_bkpt' [-Werror=missing-prototypes]
> csky/kernel/traps.c:187:17: error: no previous prototype for 'do_trap_illinsn' [-Werror=missing-prototypes]
> csky/kernel/traps.c:210:17: error: no previous prototype for 'do_trap_fpe' [-Werror=missing-prototypes]
> csky/kernel/traps.c:220:17: error: no previous prototype for 'do_trap_priv' [-Werror=missing-prototypes]
> csky/kernel/traps.c:230:17: error: no previous prototype for 'trap_c' [-Werror=missing-prototypes]
> csky/kernel/vdso/vgettimeofday.c:6:5: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes]
> csky/kernel/vdso/vgettimeofday.c:12:5: error: no previous prototype for '__vdso_clock_gettime64' [-Werror=missing-prototypes]
> csky/kernel/vdso/vgettimeofday.c:18:5: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes]
> csky/kernel/vdso/vgettimeofday.c:24:5: error: no previous prototype for '__vdso_clock_getres' [-Werror=missing-prototypes]
> csky/kernel/setup.c:104:34: error: no previous prototype for 'csky_start' [-Werror=missing-prototypes]
> csky/kernel/ptrace.c:320:16: error: no previous prototype for 'syscall_trace_enter' [-Werror=missing-prototypes]
> csky/kernel/ptrace.c:336:17: error: no previous prototype for 'syscall_trace_exit' [-Werror=missing-prototypes]
>
> I missed these as I was first looking at everything except
> -Wmissing-prototypes that I want to enable. Can you perhaps
> help out and create a fix for these yourself?
Okay, I'll check


>
> Arnd



--
Best Regards
Guo Ren