Skip to contentSkip to conversation

csky: fix old style declaration in module.c

PATCH In review Arnd Bergmann 3 participants 6 messages Jul 26, 2023 – Jul 29, 2023 C-sky architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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]

---
 arch/csky/kernel/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/csky/kernel/module.c +1 -1
index f11b3e5733448..0b56a8cd12a3d 100644
@@ -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;
 }
Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 1/1
#1 lore raw

Thx Arnd,

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

Quoted 28 lines · Arnd Bergmann

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]

---
 arch/csky/kernel/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/csky/kernel/module.c +1 -2
index f11b3e5733448..0b56a8cd12a3d 100644
@@ -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

Signature · 2 lines
Best Regards
 Guo Ren
#2 lore raw
Quoted 6 lines · Guo Ren

Thx Arnd,

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

#3 lore raw
Quoted 6 lines · Arnd Bergmann

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

maintainer
#4 lore raw
Quoted 32 lines · Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

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]

Quoted 3 lines

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

Quoted 2 lines

Arnd

Signature · 2 lines
Best Regards
 Guo Ren
maintainer
#5 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann
Quoted 6 lines · Guo Ren

Thx Arnd,

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

Quoted 8 lines

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.

Quoted 2 lines

Arnd

Signature · 2 lines
Best Regards
 Guo Ren