Skip to contentSkip to conversation

-Wmissing-prototype warning fixes

PATCH Applied Arnd Bergmann 21 participants 56 messages Nov 8, 2023 – Jan 10, 2024

Subsystems (43)

v1 of 3 Applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover -Wmissing-prototype warning fixes

From: Arnd Bergmann <[email protected]>

I slightly dropped the ball on this since last sending the series in August, but a number of warning fixes have made it into the kernel in the meantime, both from my earlier submission and from architecture maintainers.

I have none patches that remain from the previous submission, with two of them reworked according to comments. The additional patches are from more testing across architectures and configurations that I had previously missed.

At least one patch is for a newly added warning in recent kernels.

Regarding the regressions in terms of added warnings, there are now only five architectures left that add warnings (alpha, mips, nios2, sh and sparc) rather than 15, so I think we can apply the Kbuild change directly and have the architecture maintainers take care of the warnings just like the others did already.

As before, my preference would be for the patches to make it through the respective subsystem maintainer trees, though I can apply the architecture specific ones to the asm-generic tree as well.

Sorry for posting these during the merge window, I wanted to get them out before LPC so we can have them in linux-next as early as possible.

Arnd

Arnd Bergmann (22):
[RESEND^2] ida: make 'ida_dump' static
[RESEND^2] jffs2: mark __jffs2_dbg_superblock_counts() static [RESEND] kprobes: unify kprobes_exceptions_nofify() prototypes [RESEND] time: make sysfs_get_uname() function visible in header [RESEND] parport: gsc: mark init function static [RESEND] stackleak: add declarations for global functions [RESEND] sched: fair: move unused stub functions to header [v2] arch: consolidate arch_irq_work_raise prototypes [v2] arch: fix asm-offsets.c building with -Wmissing-prototypes
microblaze: include linux/cpu.h for trap_init() prototype
x86: sta2x11: include header for sta2x11_get_instance() prototype
csky: fix arch_jump_label_transform_static override
arch: add do_page_fault prototypes
arch: add missing prepare_ftrace_return() prototypes
arch: vdso: consolidate gettime prototypes
bcachefs: mark bch2_target_to_text_sb() static
powerpc: ps3: move udbg_shutdown_ps3gelic prototype
powerpc: pasemi: mark pas_shutdown() static
powerpc: powermac: mark smp_psurge_{give,take}_timebase static
usb: fsl-mph-dr-of: mark fsl_usb2_mpc5121_init() static fbdev/fsl-diu-fb: mark wr_reg_wa() static Makefile.extrawarn: turn on missing-prototypes globally

 arch/alpha/include/asm/mmu_context.h         |  2 ++
 arch/alpha/kernel/asm-offsets.c              |  2 +-
 arch/alpha/kernel/traps.c                    |  1 +
 arch/arc/include/asm/kprobes.h               |  3 ---
 arch/arm/include/asm/irq_work.h              |  2 --
 arch/arm/include/asm/kprobes.h               |  2 --
 arch/arm/include/asm/vdso.h                  |  5 ----
 arch/arm/vdso/vgettimeofday.c                |  1 +
 arch/arm64/include/asm/irq_work.h            |  2 --
 arch/arm64/include/asm/kprobes.h             |  2 --
 arch/arm64/kernel/vdso32/vgettimeofday.c     |  1 +
 arch/csky/include/asm/ftrace.h               |  4 +++
 arch/csky/include/asm/irq_work.h             |  2 +-
 arch/csky/include/asm/jump_label.h           |  5 ++++
 arch/csky/include/asm/traps.h                |  2 +-
 arch/csky/kernel/traps.c                     |  1 +
 arch/csky/kernel/vdso/vgettimeofday.c        | 11 +--------
 arch/loongarch/kernel/asm-offsets.c          | 26 ++++++++++----------
 arch/loongarch/vdso/vgettimeofday.c          |  7 +-----
 arch/m68k/coldfire/vectors.c                 |  3 +--
 arch/m68k/coldfire/vectors.h                 |  3 ---
 arch/microblaze/include/asm/ftrace.h         |  1 +
 arch/microblaze/kernel/traps.c               |  1 +
 arch/mips/include/asm/ftrace.h               |  4 +++
 arch/mips/include/asm/kprobes.h              |  2 --
 arch/mips/include/asm/traps.h                |  3 +++
 arch/mips/vdso/vgettimeofday.c               |  1 +
 arch/nios2/include/asm/traps.h               |  2 ++
 arch/powerpc/include/asm/irq_work.h          |  1 -
 arch/powerpc/include/asm/kprobes.h           |  2 --
 arch/powerpc/include/asm/ps3.h               |  6 +++++
 arch/powerpc/platforms/pasemi/setup.c        |  2 +-
 arch/powerpc/platforms/powermac/smp.c        |  4 +--
 arch/powerpc/platforms/ps3/gelic_udbg.c      |  1 +
 arch/riscv/include/asm/irq_work.h            |  2 +-
 arch/riscv/kernel/vdso/vgettimeofday.c       |  7 +-----
 arch/s390/include/asm/irq_work.h             |  2 --
 arch/s390/include/asm/kprobes.h              |  2 --
 arch/sh/include/asm/kprobes.h                |  2 --
 arch/sh/include/asm/traps_32.h               |  3 +++
 arch/sparc/include/asm/kprobes.h             |  2 --
 arch/sparc/kernel/asm-offsets.c              |  6 ++---
 arch/sparc/kernel/traps_32.c                 |  1 +
 arch/sparc/kernel/traps_64.c                 |  1 +
 arch/x86/entry/vdso/vclock_gettime.c         | 10 +-------
 arch/x86/include/asm/irq_work.h              |  1 -
 arch/x86/include/asm/kprobes.h               |  2 --
 arch/x86/include/asm/traps.h                 |  1 -
 arch/x86/include/asm/vdso/gettimeofday.h     |  2 --
 arch/x86/kernel/traps.c                      |  1 +
 arch/x86/pci/sta2x11-fixup.c                 |  1 +
 arch/x86/um/vdso/um_vdso.c                   |  1 +
 drivers/net/ethernet/toshiba/ps3_gelic_net.h |  6 -----
 drivers/parport/parport_gsc.c                |  2 +-
 drivers/usb/host/fsl-mph-dr-of.c             |  2 +-
 drivers/video/fbdev/fsl-diu-fb.c             |  2 +-
 fs/bcachefs/disk_groups.c                    |  2 +-
 fs/jffs2/debug.c                             |  2 +-
 include/linux/irq_work.h                     |  3 +++
 include/linux/kprobes.h                      |  4 +++
 include/linux/stackleak.h                    |  6 +++++
 include/vdso/gettime.h                       | 23 +++++++++++++++++
 kernel/sched/fair.c                          | 13 ----------
 kernel/sched/sched.h                         | 11 +++++++++
 kernel/time/tick-internal.h                  |  3 ++-
 lib/test_ida.c                               |  2 +-
 scripts/Makefile.extrawarn                   |  4 +--
 67 files changed, 127 insertions(+), 122 deletions(-)
 delete mode 100644 arch/m68k/coldfire/vectors.h
 create mode 100644 include/vdso/gettime.h
Signature · 70 lines
2.39.2
Cc: Matt Turner <[email protected]>
Cc: Vineet Gupta <[email protected]>
Cc: Russell King <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Guo Ren <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Greg Ungerer <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Geoff Levand <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: John Paul Adrian Glaubitz <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: [email protected]
Cc: Helge Deller <[email protected]>
Cc: Sudip Mukherjee <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Timur Tabi <[email protected]>
Cc: Kent Overstreet <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: "Naveen N. Rao" <[email protected]>
Cc: Anil S Keshavamurthy <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Vincenzo Frascino <[email protected]>
Cc: Juri Lelli <[email protected]>
Cc: Vincent Guittot <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Nick Desaulniers <[email protected]>
Cc: Nicolas Schier <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Uwe Kleine-König" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
#1 lore raw

PATCH 1/22 ida: make 'ida_dump' static

From: Arnd Bergmann <[email protected]>

There is no global declaration for ida_dump() and no other callers, so make it static to avoid this warning:

lib/test_ida.c:16:6: error: no previous prototype for 'ida_dump'

Fixes 8ab8ba38d488 ("ida: Start new test_ida module")
---
 lib/test_ida.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/test_ida.c +1 -1
index b06880625961..f946c80ced8b 100644
@@ -13,7 +13,7 @@ static unsigned int tests_run;
 static unsigned int tests_passed;
 
 #ifdef __KERNEL__
-void ida_dump(struct ida *ida) { }
+static void ida_dump(struct ida *ida) { }
 #endif
 #define IDA_BUG_ON(ida, x) do {						\
 	tests_run++;							\
Signature · 1 line
2.39.2
#2 lore raw

PATCH 2/22 jffs2: mark __jffs2_dbg_superblock_counts() static

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This function is only called locally and does not need to be global. Since there is no external prototype, gcc warns about the non-static definition:

fs/jffs2/debug.c:160:6: error: no previous prototype for '__jffs2_dbg_superblock_counts' [-Werror=missing-prototypes]

---
 fs/jffs2/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jffs2/debug.c +1 -1
index 9d26b1b9fc01..0925caab23c4 100644
@@ -157,7 +157,7 @@ __jffs2_dbg_prewrite_paranoia_check(struct jffs2_sb_info *c,
 	kfree(buf);
 }
 
-void __jffs2_dbg_superblock_counts(struct jffs2_sb_info *c)
+static void __jffs2_dbg_superblock_counts(struct jffs2_sb_info *c)
 {
 	struct jffs2_eraseblock *jeb;
 	uint32_t free = 0, dirty = 0, used = 0, wasted = 0,
Signature · 1 line
2.39.2
#4 lore raw

PATCH RESEND 3/22 kprobes: unify kprobes_exceptions_nofify() prototypes

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Most architectures that support kprobes declare this function in their own asm/kprobes.h header and provide an override, but some are missing the prototype, which causes a warning for the __weak stub implementation:

kernel/kprobes.c:1865:12: error: no previous prototype for 'kprobe_exceptions_notify' [-Werror=missing-prototypes]
1865 | int __weak kprobe_exceptions_notify(struct notifier_block *self,

Move the prototype into linux/kprobes.h so it is visible to all the definitions.

---
 arch/arc/include/asm/kprobes.h     | 3 ---
 arch/arm/include/asm/kprobes.h     | 2 --
 arch/arm64/include/asm/kprobes.h   | 2 --
 arch/mips/include/asm/kprobes.h    | 2 --
 arch/powerpc/include/asm/kprobes.h | 2 --
 arch/s390/include/asm/kprobes.h    | 2 --
 arch/sh/include/asm/kprobes.h      | 2 --
 arch/sparc/include/asm/kprobes.h   | 2 --
 arch/x86/include/asm/kprobes.h     | 2 --
 include/linux/kprobes.h            | 4 ++++
 10 files changed, 4 insertions(+), 19 deletions(-)
arch/arc/include/asm/kprobes.h +0 -3
index de1566e32cb8..68e8301c0df2 100644
@@ -32,9 +32,6 @@ struct kprobe;
 
 void arch_remove_kprobe(struct kprobe *p);
 
-int kprobe_exceptions_notify(struct notifier_block *self,
-			     unsigned long val, void *data);
-
 struct prev_kprobe {
 	struct kprobe *kp;
 	unsigned long status;
arch/arm/include/asm/kprobes.h +0 -2
index e26a278d301a..5b8dbf1b0be4 100644
@@ -40,8 +40,6 @@ struct kprobe_ctlblk {
 
 void arch_remove_kprobe(struct kprobe *);
 int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
-int kprobe_exceptions_notify(struct notifier_block *self,
-			     unsigned long val, void *data);
 
 /* optinsn template addresses */
 extern __visible kprobe_opcode_t optprobe_template_entry[];
arch/arm64/include/asm/kprobes.h +0 -2
index 05cd82eeca13..be7a3680dadf 100644
@@ -37,8 +37,6 @@ struct kprobe_ctlblk {
 
 void arch_remove_kprobe(struct kprobe *);
 int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
-int kprobe_exceptions_notify(struct notifier_block *self,
-			     unsigned long val, void *data);
 void __kretprobe_trampoline(void);
 void __kprobes *trampoline_probe_handler(struct pt_regs *regs);
 
arch/mips/include/asm/kprobes.h +0 -2
index 68b1e5d458cf..bc27d99c9436 100644
@@ -71,8 +71,6 @@ struct kprobe_ctlblk {
 	struct prev_kprobe prev_kprobe;
 };
 
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-				    unsigned long val, void *data);
 
 #endif /* CONFIG_KPROBES */
 #endif /* _ASM_KPROBES_H */
arch/powerpc/include/asm/kprobes.h +0 -2
index c8e4b4fd4e33..4525a9c68260 100644
@@ -84,8 +84,6 @@ struct arch_optimized_insn {
 	kprobe_opcode_t *insn;
 };
 
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-					unsigned long val, void *data);
 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
 extern int kprobe_handler(struct pt_regs *regs);
 extern int kprobe_post_handler(struct pt_regs *regs);
arch/s390/include/asm/kprobes.h +0 -2
index 21b9e5290c04..01f1682a73b7 100644
@@ -73,8 +73,6 @@ struct kprobe_ctlblk {
 void arch_remove_kprobe(struct kprobe *p);
 
 int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
-int kprobe_exceptions_notify(struct notifier_block *self,
-	unsigned long val, void *data);
 
 #define flush_insn_slot(p)	do { } while (0)
 
arch/sh/include/asm/kprobes.h +0 -2
index eeba83e0a7d2..65d4c3316a5b 100644
@@ -46,8 +46,6 @@ struct kprobe_ctlblk {
 };
 
 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-				    unsigned long val, void *data);
 extern int kprobe_handle_illslot(unsigned long pc);
 #else
 
arch/sparc/include/asm/kprobes.h +0 -2
index 06c2bc767ef7..aec742cd898f 100644
@@ -47,8 +47,6 @@ struct kprobe_ctlblk {
 	struct prev_kprobe prev_kprobe;
 };
 
-int kprobe_exceptions_notify(struct notifier_block *self,
-			     unsigned long val, void *data);
 int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
 asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
 				      struct pt_regs *regs);
arch/x86/include/asm/kprobes.h +0 -2
index a2e9317aad49..5939694dfb28 100644
@@ -113,8 +113,6 @@ struct kprobe_ctlblk {
 };
 
 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-				    unsigned long val, void *data);
 extern int kprobe_int3_handler(struct pt_regs *regs);
 
 #else
include/linux/kprobes.h +4 -0
index 365eb092e9c4..ab1da3142b06 100644
@@ -445,6 +445,10 @@ int kprobe_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
 
 int arch_kprobe_get_kallsym(unsigned int *symnum, unsigned long *value,
 			    char *type, char *sym);
+
+int kprobe_exceptions_notify(struct notifier_block *self,
+			     unsigned long val, void *data);
+
 #else /* !CONFIG_KPROBES: */
 
 static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
Signature · 1 line
2.39.2
#6 lore raw

PATCH RESEND 4/22 time: make sysfs_get_uname() function visible in header

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This function is defined globally in clocksource.c and used conditionally in clockevent.c, which the declaration hidden when clockevent support is disabled. This causes a harmless warning in the definition:

kernel/time/clocksource.c:1324:9: warning: no previous prototype for 'sysfs_get_uname' [-Wmissing-prototypes]
1324 | ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt)

Move the declaration out of the #ifdef so it is always visible.

---
 kernel/time/tick-internal.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/time/tick-internal.h +2 -1
index 649f2b48e8f0..481b7ab65e2c 100644
@@ -56,7 +56,6 @@ extern int clockevents_program_event(struct clock_event_device *dev,
 				     ktime_t expires, bool force);
 extern void clockevents_handle_noop(struct clock_event_device *dev);
 extern int __clockevents_update_freq(struct clock_event_device *dev, u32 freq);
-extern ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt);
 
 /* Broadcasting support */
 # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
@@ -197,3 +196,5 @@ void hrtimers_resume_local(void);
 #else
 #define JIFFIES_SHIFT	8
 #endif
+
+extern ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt);
Signature · 1 line
2.39.2
#9 lore raw

PATCH RESEND 5/22 parport: gsc: mark init function static

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This is only used locally, so mark it static to avoid a warning:

drivers/parport/parport_gsc.c:395:5: error: no previous prototype for 'parport_gsc_init' [-Werror=missing-prototypes]

---
 drivers/parport/parport_gsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parport/parport_gsc.c +1 -1
index 5e4475254bd0..c7e18382dc01 100644
@@ -392,7 +392,7 @@ static struct parisc_driver parport_driver __refdata = {
 	.remove		= __exit_p(parport_remove_chip),
 };
 
-int parport_gsc_init(void)
+static int parport_gsc_init(void)
 {
 	return register_parisc_driver(&parport_driver);
 }
Signature · 1 line
2.39.2
#11 lore raw

PATCH RESEND 6/22 stackleak: add declarations for global functions

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

With -Wmissing-prototypes enabled, the stackleak code produces a couple of warnings that have no declarations because they are only called from assembler:

stackleak.c:127:25: error: no previous prototype for 'stackleak_erase' [-Werror=missing-prototypes] stackleak.c:139:25: error: no previous prototype for 'stackleak_erase_on_task_stack' [-Werror=missing-prototypes] stackleak.c:151:25: error: no previous prototype for 'stackleak_erase_off_task_stack' [-Werror=missing-prototypes] stackleak.c:159:49: error: no previous prototype for 'stackleak_track_stack' [-Werror=missing-prototypes]

Add declarations to the stackleak header to shut up the warnings.

---
 include/linux/stackleak.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/linux/stackleak.h +6 -0
index c36e7a3b45e7..3be2cb564710 100644
@@ -14,6 +14,7 @@
 
 #ifdef CONFIG_GCC_PLUGIN_STACKLEAK
 #include <asm/stacktrace.h>
+#include <linux/linkage.h>
 
 /*
  * The lowest address on tsk's stack which we can plausibly erase.
@@ -76,6 +77,11 @@ static inline void stackleak_task_init(struct task_struct *t)
 # endif
 }
 
+asmlinkage void noinstr stackleak_erase(void);
+asmlinkage void noinstr stackleak_erase_on_task_stack(void);
+asmlinkage void noinstr stackleak_erase_off_task_stack(void);
+void __no_caller_saved_registers noinstr stackleak_track_stack(void);
+
 #else /* !CONFIG_GCC_PLUGIN_STACKLEAK */
 static inline void stackleak_task_init(struct task_struct *t) { }
 #endif
Signature · 1 line
2.39.2
#13 lore raw

PATCH RESEND 7/22 sched: fair: move unused stub functions to header

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

These four functions have a normal definition for CONFIG_FAIR_GROUP_SCHED, and empty one that is only referenced when FAIR_GROUP_SCHED is disabled but CGROUP_SCHED is still enabled. If both are turned off, the functions are still defined but the misisng prototype causes a W=1 warning:

kernel/sched/fair.c:12544:6: error: no previous prototype for 'free_fair_sched_group' kernel/sched/fair.c:12546:5: error: no previous prototype for 'alloc_fair_sched_group' kernel/sched/fair.c:12553:6: error: no previous prototype for 'online_fair_sched_group' kernel/sched/fair.c:12555:6: error: no previous prototype for 'unregister_fair_sched_group'

Move the alternatives into the header as static inline functions with the correct combination of #ifdef checks to avoid the warning without adding even more complexity.

[A different patch with the same description got applied by accident
and was later reverted, but the original patch is still missing]

Fixes 7aa55f2a5902 ("sched/fair: Move unused stub functions to header")

---
A patch with the same commit log has

---
 kernel/sched/fair.c  | 13 -------------
 kernel/sched/sched.h | 11 +++++++++++
 2 files changed, 11 insertions(+), 13 deletions(-)
kernel/sched/fair.c +0 -13
index 2048138ce54b..82b82fa1d81b 100644
@@ -12927,19 +12927,6 @@ int sched_group_set_idle(struct task_group *tg, long idle)
 	return 0;
 }
 
-#else /* CONFIG_FAIR_GROUP_SCHED */
-
-void free_fair_sched_group(struct task_group *tg) { }
-
-int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
-{
-	return 1;
-}
-
-void online_fair_sched_group(struct task_group *tg) { }
-
-void unregister_fair_sched_group(struct task_group *tg) { }
-
 #endif /* CONFIG_FAIR_GROUP_SCHED */
 
 
kernel/sched/sched.h +11 -0
index 2e5a95486a42..8f5df5250b8d 100644
@@ -436,10 +436,21 @@ static inline int walk_tg_tree(tg_visitor down, tg_visitor up, void *data)
 
 extern int tg_nop(struct task_group *tg, void *data);
 
+#ifdef CONFIG_FAIR_GROUP_SCHED
 extern void free_fair_sched_group(struct task_group *tg);
 extern int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent);
 extern void online_fair_sched_group(struct task_group *tg);
 extern void unregister_fair_sched_group(struct task_group *tg);
+#else
+static inline void free_fair_sched_group(struct task_group *tg) { }
+static inline int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
+{
+       return 1;
+}
+static inline void online_fair_sched_group(struct task_group *tg) { }
+static inline void unregister_fair_sched_group(struct task_group *tg) { }
+#endif
+
 extern void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
 			struct sched_entity *se, int cpu,
 			struct sched_entity *parent);
Signature · 1 line
2.39.2
#14 lore raw

PATCH v2 8/22 arch: consolidate arch_irq_work_raise prototypes

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The prototype was hidden in an #ifdef on x86, which causes a warning:

kernel/irq_work.c:72:13: error: no previous prototype for 'arch_irq_work_raise' [-Werror=missing-prototypes]

Some architectures have a working prototype, while others don't. Fix this by providing it in only one place that is always visible.

---
v2: clarify changelog text

---
 arch/arm/include/asm/irq_work.h     | 2 --
 arch/arm64/include/asm/irq_work.h   | 2 --
 arch/csky/include/asm/irq_work.h    | 2 +-
 arch/powerpc/include/asm/irq_work.h | 1 -
 arch/riscv/include/asm/irq_work.h   | 2 +-
 arch/s390/include/asm/irq_work.h    | 2 --
 arch/x86/include/asm/irq_work.h     | 1 -
 include/linux/irq_work.h            | 3 +++
 8 files changed, 5 insertions(+), 10 deletions(-)
arch/arm/include/asm/irq_work.h +0 -2
index 3149e4dc1b54..8895999834cc 100644
@@ -9,6 +9,4 @@ static inline bool arch_irq_work_has_interrupt(void)
 	return is_smp();
 }
 
-extern void arch_irq_work_raise(void);
-
 #endif /* _ASM_ARM_IRQ_WORK_H */
arch/arm64/include/asm/irq_work.h +0 -2
index 81bbfa3a035b..a1020285ea75 100644
@@ -2,8 +2,6 @@
 #ifndef __ASM_IRQ_WORK_H
 #define __ASM_IRQ_WORK_H
 
-extern void arch_irq_work_raise(void);
-
 static inline bool arch_irq_work_has_interrupt(void)
 {
 	return true;
arch/csky/include/asm/irq_work.h +1 -1
index 33aaf39d6f94..d39fcc1f5395 100644
@@ -7,5 +7,5 @@ static inline bool arch_irq_work_has_interrupt(void)
 {
 	return true;
 }
-extern void arch_irq_work_raise(void);
+
 #endif /* __ASM_CSKY_IRQ_WORK_H */
arch/powerpc/include/asm/irq_work.h +0 -1
index b8b0be8f1a07..c6d3078bd8c3 100644
@@ -6,6 +6,5 @@ static inline bool arch_irq_work_has_interrupt(void)
 {
 	return true;
 }
-extern void arch_irq_work_raise(void);
 
 #endif /* _ASM_POWERPC_IRQ_WORK_H */
arch/riscv/include/asm/irq_work.h +1 -1
index b53891964ae0..b27a4d64fc6a 100644
@@ -6,5 +6,5 @@ static inline bool arch_irq_work_has_interrupt(void)
 {
 	return IS_ENABLED(CONFIG_SMP);
 }
-extern void arch_irq_work_raise(void);
+
 #endif /* _ASM_RISCV_IRQ_WORK_H */
arch/s390/include/asm/irq_work.h +0 -2
index 603783766d0a..f00c9f610d5a 100644
@@ -7,6 +7,4 @@ static inline bool arch_irq_work_has_interrupt(void)
 	return true;
 }
 
-void arch_irq_work_raise(void);
-
 #endif /* _ASM_S390_IRQ_WORK_H */
arch/x86/include/asm/irq_work.h +0 -1
index 800ffce0db29..6b4d36c95165 100644
@@ -9,7 +9,6 @@ static inline bool arch_irq_work_has_interrupt(void)
 {
 	return boot_cpu_has(X86_FEATURE_APIC);
 }
-extern void arch_irq_work_raise(void);
 #else
 static inline bool arch_irq_work_has_interrupt(void)
 {
include/linux/irq_work.h +3 -0
index 8cd11a223260..136f2980cba3 100644
@@ -66,6 +66,9 @@ void irq_work_sync(struct irq_work *work);
 void irq_work_run(void);
 bool irq_work_needs_cpu(void);
 void irq_work_single(void *arg);
+
+void arch_irq_work_raise(void);
+
 #else
 static inline bool irq_work_needs_cpu(void) { return false; }
 static inline void irq_work_run(void) { }
Signature · 1 line
2.39.2
#17 lore raw

PATCH v2 9/22 arch: fix asm-offsets.c building with -Wmissing-prototypes

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When -Wmissing-prototypes is enabled, the some asm-offsets.c files fail to build, even when this warning is disabled in the Makefile for normal files:

arch/sparc/kernel/asm-offsets.c:22:5: error: no previous prototype for 'sparc32_foo' [-Werror=missing-prototypes] arch/sparc/kernel/asm-offsets.c:48:5: error: no previous prototype for 'foo' [-Werror=missing-prototypes]

Address this by making use of the same trick as x86, marking these functions as 'static __used' to avoid the need for a prototype by not drop them in dead-code elimination.

---
v2: rewrite using a different approach

---
 arch/alpha/kernel/asm-offsets.c     |  2 +-
 arch/loongarch/kernel/asm-offsets.c | 26 +++++++++++++-------------
 arch/sparc/kernel/asm-offsets.c     |  6 +++---
 3 files changed, 17 insertions(+), 17 deletions(-)
arch/alpha/kernel/asm-offsets.c +1 -1
index b121294bee26..bf1eedd27cf7 100644
@@ -12,7 +12,7 @@
 #include <linux/kbuild.h>
 #include <asm/io.h>
 
-void foo(void)
+static void __used foo(void)
 {
 	DEFINE(TI_TASK, offsetof(struct thread_info, task));
 	DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
arch/loongarch/kernel/asm-offsets.c +13 -13
index 173fe514fc9e..bee9f7a3108f 100644
@@ -15,7 +15,7 @@
 #include <asm/processor.h>
 #include <asm/ftrace.h>
 
-void output_ptreg_defines(void)
+static void __used output_ptreg_defines(void)
 {
 	COMMENT("LoongArch pt_regs offsets.");
 	OFFSET(PT_R0, pt_regs, regs[0]);
@@ -62,7 +62,7 @@ void output_ptreg_defines(void)
 	BLANK();
 }
 
-void output_task_defines(void)
+static void __used output_task_defines(void)
 {
 	COMMENT("LoongArch task_struct offsets.");
 	OFFSET(TASK_STATE, task_struct, __state);
@@ -77,7 +77,7 @@ void output_task_defines(void)
 	BLANK();
 }
 
-void output_thread_info_defines(void)
+static void __used output_thread_info_defines(void)
 {
 	COMMENT("LoongArch thread_info offsets.");
 	OFFSET(TI_TASK, thread_info, task);
@@ -93,7 +93,7 @@ void output_thread_info_defines(void)
 	BLANK();
 }
 
-void output_thread_defines(void)
+static void __used output_thread_defines(void)
 {
 	COMMENT("LoongArch specific thread_struct offsets.");
 	OFFSET(THREAD_REG01, task_struct, thread.reg01);
@@ -129,7 +129,7 @@ void output_thread_defines(void)
 	BLANK();
 }
 
-void output_thread_fpu_defines(void)
+static void __used output_thread_fpu_defines(void)
 {
 	OFFSET(THREAD_FPR0, loongarch_fpu, fpr[0]);
 	OFFSET(THREAD_FPR1, loongarch_fpu, fpr[1]);
@@ -170,7 +170,7 @@ void output_thread_fpu_defines(void)
 	BLANK();
 }
 
-void output_thread_lbt_defines(void)
+static void __used output_thread_lbt_defines(void)
 {
 	OFFSET(THREAD_SCR0,  loongarch_lbt, scr0);
 	OFFSET(THREAD_SCR1,  loongarch_lbt, scr1);
@@ -180,7 +180,7 @@ void output_thread_lbt_defines(void)
 	BLANK();
 }
 
-void output_mm_defines(void)
+static void __used output_mm_defines(void)
 {
 	COMMENT("Size of struct page");
 	DEFINE(STRUCT_PAGE_SIZE, sizeof(struct page));
@@ -212,7 +212,7 @@ void output_mm_defines(void)
 	BLANK();
 }
 
-void output_sc_defines(void)
+static void __used output_sc_defines(void)
 {
 	COMMENT("Linux sigcontext offsets.");
 	OFFSET(SC_REGS, sigcontext, sc_regs);
@@ -220,7 +220,7 @@ void output_sc_defines(void)
 	BLANK();
 }
 
-void output_signal_defines(void)
+static void __used output_signal_defines(void)
 {
 	COMMENT("Linux signal numbers.");
 	DEFINE(_SIGHUP, SIGHUP);
@@ -258,7 +258,7 @@ void output_signal_defines(void)
 }
 
 #ifdef CONFIG_SMP
-void output_smpboot_defines(void)
+static void __used output_smpboot_defines(void)
 {
 	COMMENT("Linux smp cpu boot offsets.");
 	OFFSET(CPU_BOOT_STACK, secondary_data, stack);
@@ -268,7 +268,7 @@ void output_smpboot_defines(void)
 #endif
 
 #ifdef CONFIG_HIBERNATION
-void output_pbe_defines(void)
+static void __used output_pbe_defines(void)
 {
 	COMMENT("Linux struct pbe offsets.");
 	OFFSET(PBE_ADDRESS, pbe, address);
@@ -280,7 +280,7 @@ void output_pbe_defines(void)
 #endif
 
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
-void output_fgraph_ret_regs_defines(void)
+static void __used output_fgraph_ret_regs_defines(void)
 {
 	COMMENT("LoongArch fgraph_ret_regs offsets.");
 	OFFSET(FGRET_REGS_A0, fgraph_ret_regs, regs[0]);
@@ -291,7 +291,7 @@ void output_fgraph_ret_regs_defines(void)
 }
 #endif
 
-void output_kvm_defines(void)
+static void __used output_kvm_defines(void)
 {
 	COMMENT("KVM/LoongArch Specific offsets.");
 
arch/sparc/kernel/asm-offsets.c +3 -3
index 5784f2df489a..3d9b9855dce9 100644
@@ -19,14 +19,14 @@
 #include <asm/hibernate.h>
 
 #ifdef CONFIG_SPARC32
-int sparc32_foo(void)
+static int __used sparc32_foo(void)
 {
 	DEFINE(AOFF_thread_fork_kpsr,
 			offsetof(struct thread_struct, fork_kpsr));
 	return 0;
 }
 #else
-int sparc64_foo(void)
+static int __used sparc64_foo(void)
 {
 #ifdef CONFIG_HIBERNATION
 	BLANK();
@@ -45,7 +45,7 @@ int sparc64_foo(void)
 }
 #endif
 
-int foo(void)
+static int __used foo(void)
 {
 	BLANK();
 	DEFINE(AOFF_task_thread, offsetof(struct task_struct, thread));
Signature · 1 line
2.39.2
#19 lore raw

PATCH 10/22 microblaze: include linux/cpu.h for trap_init() prototype

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Microblaze runs into a single -Wmissing-prototypes warning when that is enabled:

arch/microblaze/kernel/traps.c:21:6: warning: no previous prototype for 'trap_init' [-Wmissing-prototypes]

Include the right header to avoid this.

---
 arch/alpha/kernel/traps.c      | 1 +
 arch/csky/include/asm/traps.h  | 2 --
 arch/csky/kernel/traps.c       | 1 +
 arch/m68k/coldfire/vectors.c   | 3 +--
 arch/m68k/coldfire/vectors.h   | 3 ---
 arch/microblaze/kernel/traps.c | 1 +
 arch/sparc/kernel/traps_32.c   | 1 +
 arch/sparc/kernel/traps_64.c   | 1 +
 arch/x86/include/asm/traps.h   | 1 -
 arch/x86/kernel/traps.c        | 1 +
 10 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 100644 arch/m68k/coldfire/vectors.h
arch/alpha/kernel/traps.c +1 -0
index d9a67b370e04..7fc72aeb7398 100644
@@ -9,6 +9,7 @@
  * This file initializes the trap entry points
  */
 
+#include <linux/cpu.h>
 #include <linux/jiffies.h>
 #include <linux/mm.h>
 #include <linux/sched/signal.h>
arch/csky/include/asm/traps.h +0 -2
index 732c4aaa2e26..495ce318d569 100644
@@ -55,6 +55,4 @@ asmlinkage void trap_c(struct pt_regs *regs);
 asmlinkage void do_notify_resume(struct pt_regs *regs,
 			unsigned long thread_info_flags);
 
-void trap_init(void);
-
 #endif /* __ASM_CSKY_TRAPS_H */
arch/csky/kernel/traps.c +1 -0
index 6e426fba0119..c2246b07cc9c 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
 
+#include <linux/cpu.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/kernel.h>
arch/m68k/coldfire/vectors.c +1 -2
index c26c255b530d..4321fd89d83e 100644
@@ -12,14 +12,13 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/irq.h>
+#include <linux/cpu.h>
 #include <asm/traps.h>
 #include <asm/machdep.h>
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
 #include <asm/mcfwdebug.h>
 
-#include "vectors.h"
-
 /***************************************************************************/
 
 #ifdef TRAP_DBG_INTERRUPT
arch/m68k/coldfire/vectors.h deleted +0 -3
deleted file mode 100644
index 0b01450a4353..000000000000
@@ -1,3 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-void trap_init(void);
arch/microblaze/kernel/traps.c +1 -0
index 94b6fe93147d..080aa769218d 100644
@@ -8,6 +8,7 @@
  * for more details.
  */
 
+#include <linux/cpu.h>
 #include <linux/export.h>
 #include <linux/kernel.h>
 #include <linux/kallsyms.h>
arch/sparc/kernel/traps_32.c +1 -0
index 179aabfa712e..bb149f6cc34b 100644
@@ -10,6 +10,7 @@
  * I hate traps on the sparc, grrr...
  */
 
+#include <linux/cpu.h>
 #include <linux/sched/mm.h>
 #include <linux/sched/debug.h>
 #include <linux/mm_types.h>
arch/sparc/kernel/traps_64.c +1 -0
index 08ffd17d5ec3..3631899f2394 100644
@@ -9,6 +9,7 @@
  * I like traps on v9, :))))
  */
 
+#include <linux/cpu.h>
 #include <linux/extable.h>
 #include <linux/sched/mm.h>
 #include <linux/sched/debug.h>
arch/x86/include/asm/traps.h +0 -1
index b1c9cea6ba88..1f1deaecd364 100644
@@ -14,7 +14,6 @@
 asmlinkage __visible notrace struct pt_regs *sync_regs(struct pt_regs *eregs);
 asmlinkage __visible notrace
 struct pt_regs *fixup_bad_iret(struct pt_regs *bad_regs);
-void __init trap_init(void);
 asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *eregs);
 #endif
 
arch/x86/kernel/traps.c +1 -0
index c876f1d36a81..b0737a15c470 100644
@@ -37,6 +37,7 @@
 #include <linux/nmi.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
+#include <linux/cpu.h>
 #include <linux/io.h>
 #include <linux/hardirq.h>
 #include <linux/atomic.h>
Signature · 1 line
2.39.2
#23 lore raw

PATCH 11/22 x86: sta2x11: include header for sta2x11_get_instance() prototype

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

sta2x11_get_instance() is a global function declared in asm/sta2x11.h, but this header is not included before the definition, causing a warning:

arch/x86/pci/sta2x11-fixup.c:95:26: error: no previous prototype for 'sta2x11_get_instance' [-Werror=missing-prototypes]

Add the missing #include.

Fixes 83125a3a189e ("x86, platform: Initial support for sta2x11 I/O hub")
---
 arch/x86/pci/sta2x11-fixup.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/pci/sta2x11-fixup.c +1 -0
index 7368afc03998..8c8ddc4dcc08 100644
@@ -14,6 +14,7 @@
 #include <linux/dma-map-ops.h>
 #include <linux/swiotlb.h>
 #include <asm/iommu.h>
+#include <asm/sta2x11.h>
 
 #define STA2X11_SWIOTLB_SIZE (4*1024*1024)
 
Signature · 1 line
2.39.2
#24 lore raw

PATCH 12/22 csky: fix arch_jump_label_transform_static override

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The arch_jump_label_transform_static() function in csky was originally meant to override the generic __weak function, but that got changed to an #ifndef check.

This showed up as a missing-prototype warning:
arch/csky/kernel/jump_label.c:43:6: error: no previous prototype for 'arch_jump_label_transform_static' [-Werror=missing-prototypes]

Change the method to use the new method of having a #define and a prototype for the global function.

Fixes 7e6b9db27de9 ("jump_label: make initial NOP patching the special case")
Fixes 4e8bb4ba5a55 ("csky: Add jump-label implementation")
---
 arch/csky/include/asm/jump_label.h | 5 +++++
 1 file changed, 5 insertions(+)
arch/csky/include/asm/jump_label.h +5 -0
index d488ba6084bc..98a3f4b168bd 100644
@@ -43,5 +43,10 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key,
 	return true;
 }
 
+enum jump_label_type;
+void arch_jump_label_transform_static(struct jump_entry *entry,
+				      enum jump_label_type type);
+#define arch_jump_label_transform_static arch_jump_label_transform_static
+
 #endif  /* __ASSEMBLY__ */
 #endif	/* __ASM_CSKY_JUMP_LABEL_H */
Signature · 1 line
2.39.2
#26 lore raw

PATCH 13/22 arch: add do_page_fault prototypes

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

arch/alpha/mm/fault.c:85:1: error: no previous prototype for 'do_page_fault' [-Werror=missing-prototypes] arch/csky/mm/fault.c:187:17: error: no previous prototype for 'do_page_fault' [-Werror=missing-prototypes] arch/mips/mm/fault.c:323:17: error: no previous prototype for 'do_page_fault' [-Werror=missing-prototypes] arch/nios2/mm/fault.c:43:17: error: no previous prototype for 'do_page_fault' [-Werror=missing-prototypes] arch/sh/mm/fault.c:389:27: error: no previous prototype for 'do_page_fault' [-Werror=missing-prototypes]

---
 arch/alpha/include/asm/mmu_context.h | 2 ++
 arch/csky/include/asm/traps.h        | 2 ++
 arch/mips/include/asm/traps.h        | 3 +++
 arch/nios2/include/asm/traps.h       | 2 ++
 arch/sh/include/asm/traps_32.h       | 3 +++
 5 files changed, 12 insertions(+)
arch/alpha/include/asm/mmu_context.h +2 -0
index 4eea7c616992..29a3e3a1f02b 100644
@@ -183,6 +183,8 @@ ev4_switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
 }
 
 extern void __load_new_mm_context(struct mm_struct *);
+asmlinkage void do_page_fault(unsigned long address, unsigned long mmcsr,
+			      long cause, struct pt_regs *regs);
 
 #ifdef CONFIG_SMP
 #define check_mmu_context()					\
arch/csky/include/asm/traps.h +2 -0
index 495ce318d569..6bbbbe43165f 100644
@@ -55,4 +55,6 @@ asmlinkage void trap_c(struct pt_regs *regs);
 asmlinkage void do_notify_resume(struct pt_regs *regs,
 			unsigned long thread_info_flags);
 
+asmlinkage void do_page_fault(struct pt_regs *regs);
+
 #endif /* __ASM_CSKY_TRAPS_H */
arch/mips/include/asm/traps.h +3 -0
index 15cde638b407..d4d9f8a8fdea 100644
@@ -39,4 +39,7 @@ extern char except_vec_nmi[];
 	register_nmi_notifier(&fn##_nb);				\
 })
 
+asmlinkage void do_page_fault(struct pt_regs *regs,
+	unsigned long write, unsigned long address);
+
 #endif /* _ASM_TRAPS_H */
arch/nios2/include/asm/traps.h +2 -0
index 82a48473280d..afd77bef01c6 100644
@@ -14,6 +14,8 @@
 
 #ifndef __ASSEMBLY__
 void _exception(int signo, struct pt_regs *regs, int code, unsigned long addr);
+void do_page_fault(struct pt_regs *regs, unsigned long cause,
+		   unsigned long address);
 #endif
 
 #endif /* _ASM_NIOS2_TRAPS_H */
arch/sh/include/asm/traps_32.h +3 -0
index 8c5bbb7b6053..8f14071bea72 100644
@@ -43,6 +43,9 @@ static inline void trigger_address_error(void)
 asmlinkage void do_address_error(struct pt_regs *regs,
 				 unsigned long writeaccess,
 				 unsigned long address);
+asmlinkage void do_page_fault(struct pt_regs *regs,
+			      unsigned long error_code,
+			      unsigned long address);
 asmlinkage void do_divide_error(unsigned long r4);
 asmlinkage void do_reserved_inst(void);
 asmlinkage void do_illegal_slot_inst(void);
Signature · 1 line
2.39.2
#27 lore raw

PATCH 14/22 arch: add missing prepare_ftrace_return() prototypes

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The prototype for prepare_ftrace_return() is architecture specific and can't be in a global header. Since it's normally called from assembly, it doesn't really need a prototype, but we get a warning if it's missing:

arch/csky/kernel/ftrace.c:147:6: error: no previous prototype for 'prepare_ftrace_return' [-Werror=missing-prototypes] arch/microblaze/kernel/ftrace.c:22:6: error: no previous prototype for 'prepare_ftrace_return' [-Werror=missing-prototypes] arch/mips/kernel/ftrace.c:305:6: error: no previous prototype for 'prepare_ftrace_return' [-Werror=missing-prototypes]

Add the prototypes for the three architectures that don't already have one in asm/ftrace.h.

---
 arch/csky/include/asm/ftrace.h       | 4 ++++
 arch/microblaze/include/asm/ftrace.h | 1 +
 arch/mips/include/asm/ftrace.h       | 4 ++++
 3 files changed, 9 insertions(+)
arch/csky/include/asm/ftrace.h +4 -0
index 9b86341731b6..fd215c38ef27 100644
@@ -26,5 +26,9 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
 
 struct dyn_arch_ftrace {
 };
+
+void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
+			   unsigned long frame_pointer);
+
 #endif /* !__ASSEMBLY__ */
 #endif /* __ASM_CSKY_FTRACE_H */
arch/microblaze/include/asm/ftrace.h +1 -0
index 6a92bed37794..4ca38b92a3a2 100644
@@ -10,6 +10,7 @@
 #ifndef __ASSEMBLY__
 extern void _mcount(void);
 extern void ftrace_call_graph(void);
+void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr);
 #endif
 
 #ifdef CONFIG_DYNAMIC_FTRACE
arch/mips/include/asm/ftrace.h +4 -0
index db497a8167da..dc025888f6d2 100644
@@ -85,6 +85,10 @@ struct dyn_arch_ftrace {
 };
 
 #endif /*  CONFIG_DYNAMIC_FTRACE */
+
+void prepare_ftrace_return(unsigned long *parent_ra_addr, unsigned long self_ra,
+			   unsigned long fp);
+
 #endif /* __ASSEMBLY__ */
 #endif /* CONFIG_FUNCTION_TRACER */
 #endif /* _ASM_MIPS_FTRACE_H */
Signature · 1 line
2.39.2
#28 lore raw

PATCH 15/22 arch: vdso: consolidate gettime prototypes

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The VDSO functions are defined as globals in the kernel sources but intended to be called from userspace, so there is no need to declare them in a kernel side header.

Without a prototype, this now causes warnings such as

arch/mips/vdso/vgettimeofday.c:14:5: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes] arch/mips/vdso/vgettimeofday.c:28:5: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes] arch/mips/vdso/vgettimeofday.c:36:5: error: no previous prototype for '__vdso_clock_getres' [-Werror=missing-prototypes] arch/mips/vdso/vgettimeofday.c:42:5: error: no previous prototype for '__vdso_clock_gettime64' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:254:1: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:282:1: error: no previous prototype for '__vdso_clock_gettime_stick' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:307:1: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:343:1: error: no previous prototype for '__vdso_gettimeofday_stick' [-Werror=missing-prototypes]

Most architectures have already added workarounds for these by adding declarations somewhere, but since these are all compatible, we should really just have one copy, with an #ifdef check for the 32-bit vs 64-bit variant and use that everywhere.

Unfortunately, the sparc version is currently incompatible since that never added support for __vdso_clock_gettime64() in 32-bit userland. For the moment, I'm leaving this one out, as I can't easily test it and it requires a larger rework.

---
 arch/arm/include/asm/vdso.h              |  5 -----
 arch/arm/vdso/vgettimeofday.c            |  1 +
 arch/arm64/kernel/vdso32/vgettimeofday.c |  1 +
 arch/csky/kernel/vdso/vgettimeofday.c    | 11 +----------
 arch/loongarch/vdso/vgettimeofday.c      |  7 +------
 arch/mips/vdso/vgettimeofday.c           |  1 +
 arch/riscv/kernel/vdso/vgettimeofday.c   |  7 +------
 arch/x86/entry/vdso/vclock_gettime.c     | 10 +---------
 arch/x86/include/asm/vdso/gettimeofday.h |  2 --
 arch/x86/um/vdso/um_vdso.c               |  1 +
 include/vdso/gettime.h                   | 23 +++++++++++++++++++++++
 11 files changed, 31 insertions(+), 38 deletions(-)
 create mode 100644 include/vdso/gettime.h
arch/arm/include/asm/vdso.h +0 -5
index 422c3afa806a..5b85889f82ee 100644
@@ -24,11 +24,6 @@ static inline void arm_install_vdso(struct mm_struct *mm, unsigned long addr)
 
 #endif /* CONFIG_VDSO */
 
-int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts);
-int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts);
-int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
-int __vdso_clock_getres(clockid_t clock_id, struct old_timespec32 *res);
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
arch/arm/vdso/vgettimeofday.c +1 -0
index a003beacac76..3554aa35f1ba 100644
@@ -8,6 +8,7 @@
 #include <linux/types.h>
 #include <asm/vdso.h>
 #include <asm/unwind.h>
+#include <vdso/gettime.h>
 
 int __vdso_clock_gettime(clockid_t clock,
 			 struct old_timespec32 *ts)
arch/arm64/kernel/vdso32/vgettimeofday.c +1 -0
index 5acff29c5991..e23c7f4ef26b 100644
@@ -5,6 +5,7 @@
  * Copyright (C) 2018 ARM Limited
  *
  */
+#include <vdso/gettime.h>
 
 int __vdso_clock_gettime(clockid_t clock,
 			 struct old_timespec32 *ts)
arch/csky/kernel/vdso/vgettimeofday.c +1 -10
index c4831145eed5..55af30e83752 100644
@@ -2,36 +2,27 @@
 
 #include <linux/time.h>
 #include <linux/types.h>
+#include <vdso/gettime.h>
 
 extern
-int __vdso_clock_gettime(clockid_t clock,
-			 struct old_timespec32 *ts);
 int __vdso_clock_gettime(clockid_t clock,
 			 struct old_timespec32 *ts)
 {
 	return __cvdso_clock_gettime32(clock, ts);
 }
 
-int __vdso_clock_gettime64(clockid_t clock,
-			   struct __kernel_timespec *ts);
 int __vdso_clock_gettime64(clockid_t clock,
 			   struct __kernel_timespec *ts)
 {
 	return __cvdso_clock_gettime(clock, ts);
 }
 
-extern
-int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
-			struct timezone *tz);
 int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
 			struct timezone *tz)
 {
 	return __cvdso_gettimeofday(tv, tz);
 }
 
-extern
-int __vdso_clock_getres(clockid_t clock_id,
-			struct old_timespec32 *res);
 int __vdso_clock_getres(clockid_t clock_id,
 			struct old_timespec32 *res)
 {
arch/loongarch/vdso/vgettimeofday.c +1 -6
index 8f22863bd7ea..0885c1f3a89d 100644
@@ -5,23 +5,18 @@
  * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  */
 #include <linux/types.h>
+#include <vdso/gettime.h>
 
-extern
-int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
 int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
 {
 	return __cvdso_clock_gettime(clock, ts);
 }
 
-extern
-int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
 {
 	return __cvdso_gettimeofday(tv, tz);
 }
 
-extern
-int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res);
 int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res)
 {
 	return __cvdso_clock_getres(clock_id, res);
arch/mips/vdso/vgettimeofday.c +1 -0
index 6b83b6376a4b..604afea3f336 100644
@@ -9,6 +9,7 @@
  */
 #include <linux/time.h>
 #include <linux/types.h>
+#include <vdso/gettime.h>
 
 #if _MIPS_SIM != _MIPS_SIM_ABI64
 int __vdso_clock_gettime(clockid_t clock,
arch/riscv/kernel/vdso/vgettimeofday.c +1 -6
index cc0d80699c31..b35057802584 100644
@@ -8,23 +8,18 @@
 
 #include <linux/time.h>
 #include <linux/types.h>
+#include <vdso/gettime.h>
 
-extern
-int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
 int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
 {
 	return __cvdso_clock_gettime(clock, ts);
 }
 
-extern
-int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
 {
 	return __cvdso_gettimeofday(tv, tz);
 }
 
-extern
-int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res);
 int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res)
 {
 	return __cvdso_clock_getres(clock_id, res);
arch/x86/entry/vdso/vclock_gettime.c +1 -9
index 7d70935b6758..0debc194bd78 100644
@@ -11,12 +11,10 @@
 #include <linux/time.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
+#include <vdso/gettime.h>
 
 #include "../../../../lib/vdso/gettimeofday.c"
 
-extern int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
-extern __kernel_old_time_t __vdso_time(__kernel_old_time_t *t);
-
 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
 {
 	return __cvdso_gettimeofday(tv, tz);
@@ -35,9 +33,6 @@ __kernel_old_time_t time(__kernel_old_time_t *t)	__attribute__((weak, alias("__v
 
 #if defined(CONFIG_X86_64) && !defined(BUILD_VDSO32_64)
 /* both 64-bit and x32 use these */
-extern int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
-extern int __vdso_clock_getres(clockid_t clock, struct __kernel_timespec *res);
-
 int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
 {
 	return __cvdso_clock_gettime(clock, ts);
@@ -56,9 +51,6 @@ int clock_getres(clockid_t, struct __kernel_timespec *)
 
 #else
 /* i386 only */
-extern int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts);
-extern int __vdso_clock_getres(clockid_t clock, struct old_timespec32 *res);
-
 int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts)
 {
 	return __cvdso_clock_gettime32(clock, ts);
arch/x86/include/asm/vdso/gettimeofday.h +0 -2
index c81858d903dc..a46edb0e0cf7 100644
@@ -337,8 +337,6 @@ u64 vdso_calc_delta(u64 cycles, u64 last, u64 mask, u32 mult)
 }
 #define vdso_calc_delta vdso_calc_delta
 
-int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts);
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_VDSO_GETTIMEOFDAY_H */
arch/x86/um/vdso/um_vdso.c +1 -0
index ff0f3b4b6c45..63768dd347ce 100644
@@ -12,6 +12,7 @@
 #include <linux/time.h>
 #include <linux/getcpu.h>
 #include <asm/unistd.h>
+#include <vdso/gettime.h>
 
 int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
 {
include/vdso/gettime.h new file +23 -0
new file mode 100644
index 000000000000..c50d152e7b3e
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _VDSO_GETTIME_H
+#define _VDSO_GETTIME_H
+
+#include <linux/types.h>
+
+struct __kernel_timespec;
+struct timezone;
+
+#if !defined(CONFIG_64BIT) || defined(BUILD_VDSO32_64)
+struct old_timespec32;
+int __vdso_clock_getres(clockid_t clock, struct old_timespec32 *res);
+int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts);
+#else
+int __vdso_clock_getres(clockid_t clock, struct __kernel_timespec *res);
+int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
+#endif
+
+__kernel_old_time_t __vdso_time(__kernel_old_time_t *t);
+int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
+int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts);
+
+#endif
Signature · 1 line
2.39.2
#39 lore raw

PATCH 16/22 bcachefs: mark bch2_target_to_text_sb() static

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

bch2_target_to_text_sb() is only called in the file it is defined in, and it has no extern prototype:

fs/bcachefs/disk_groups.c:583:6: error: no previous prototype for 'bch2_target_to_text_sb' [-Werror=missing-prototypes]

Mark it static to avoid the warning and have the code better optimized.

Fixes bf0d9e89de2e ("bcachefs: Split apart bch2_target_to_text(), bch2_target_to_text_sb()")
---
 fs/bcachefs/disk_groups.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bcachefs/disk_groups.c +1 -1
index d613695abf9f..1f334124055b 100644
@@ -580,7 +580,7 @@ void bch2_target_to_text(struct printbuf *out, struct bch_fs *c, unsigned v)
 	}
 }
 
-void bch2_target_to_text_sb(struct printbuf *out, struct bch_sb *sb, unsigned v)
+static void bch2_target_to_text_sb(struct printbuf *out, struct bch_sb *sb, unsigned v)
 {
 	struct target t = target_decode(v);
 
Signature · 1 line
2.39.2
#41 lore raw

PATCH 17/22 powerpc: ps3: move udbg_shutdown_ps3gelic prototype

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Allmodconfig kernels produce a missing-prototypes warning:

arch/powerpc/platforms/ps3/gelic_udbg.c:239:6: error: no previous prototype for 'udbg_shutdown_ps3gelic' [-Werror=missing-prototypes]

Move the declaration from a local header to asm/ps3.h where it can be seen from both the caller and the definition.

---
 arch/powerpc/include/asm/ps3.h               | 6 ++++++
 arch/powerpc/platforms/ps3/gelic_udbg.c      | 1 +
 drivers/net/ethernet/toshiba/ps3_gelic_net.h | 6 ------
 3 files changed, 7 insertions(+), 6 deletions(-)
arch/powerpc/include/asm/ps3.h +6 -0
index a5f36546a052..d13d8fdc3411 100644
@@ -514,4 +514,10 @@ u64 ps3_get_spe_id(void *arg);
 
 void ps3_early_mm_init(void);
 
+#ifdef CONFIG_PPC_EARLY_DEBUG_PS3GELIC
+void udbg_shutdown_ps3gelic(void);
+#else
+static inline void udbg_shutdown_ps3gelic(void) {}
+#endif
+
 #endif
arch/powerpc/platforms/ps3/gelic_udbg.c +1 -0
index 6b298010fd84..a5202c18c236 100644
@@ -14,6 +14,7 @@
 #include <linux/ip.h>
 #include <linux/udp.h>
 
+#include <asm/ps3.h>
 #include <asm/io.h>
 #include <asm/udbg.h>
 #include <asm/lv1call.h>
drivers/net/ethernet/toshiba/ps3_gelic_net.h +0 -6
index 0d98defb011e..0ec7412febc7 100644
@@ -346,12 +346,6 @@ static inline void *port_priv(struct gelic_port *port)
 	return port->priv;
 }
 
-#ifdef CONFIG_PPC_EARLY_DEBUG_PS3GELIC
-void udbg_shutdown_ps3gelic(void);
-#else
-static inline void udbg_shutdown_ps3gelic(void) {}
-#endif
-
 int gelic_card_set_irq_mask(struct gelic_card *card, u64 mask);
 /* shared netdev ops */
 void gelic_card_up(struct gelic_card *card);
Signature · 1 line
2.39.2
#48 lore raw

PATCH 18/22 powerpc: pasemi: mark pas_shutdown() static

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Allmodconfig builds show a warning about one function that is accidentally marked global:

arch/powerpc/platforms/pasemi/setup.c:67:6: error: no previous prototype for 'pas_shutdown' [-Werror=missing-prototypes]

Fixes 656fdf3ad8e0 ("powerpc/pasemi: Add Nemo board device init code.")
---
 arch/powerpc/platforms/pasemi/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/pasemi/setup.c +1 -1
index ef985ba2bf21..0761d98e5be3 100644
@@ -64,7 +64,7 @@ static void __noreturn pas_restart(char *cmd)
 }
 
 #ifdef CONFIG_PPC_PASEMI_NEMO
-void pas_shutdown(void)
+static void pas_shutdown(void)
 {
 	/* Set the PLD bit that makes the SB600 think the power button is being pressed */
 	void __iomem *pld_map = ioremap(0xf5000000,4096);
Signature · 1 line
2.39.2
#49 lore raw

PATCH 19/22 powerpc: powermac: mark smp_psurge_{give,take}_timebase static

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

These functions are only called locally and should be static like the other corresponding functions are:

arch/powerpc/platforms/powermac/smp.c:416:13: error: no previous prototype for 'smp_psurge_take_timebase' [-Werror=missing-prototypes]
416 | void __init smp_psurge_take_timebase(void)

      |             ^~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/platforms/powermac/smp.c:432:13: error: no previous prototype for 'smp_psurge_give_timebase' [-Werror=missing-prototypes]
  432 | void __init smp_psurge_give_timebase(void)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~
---
 arch/powerpc/platforms/powermac/smp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powermac/smp.c +2 -2
index c83d1e14077e..15644be31990 100644
@@ -413,7 +413,7 @@ static void __init smp_psurge_setup_cpu(int cpu_nr)
 		printk(KERN_ERR "Couldn't get primary IPI interrupt");
 }
 
-void __init smp_psurge_take_timebase(void)
+static void __init smp_psurge_take_timebase(void)
 {
 	if (psurge_type != PSURGE_DUAL)
 		return;
@@ -429,7 +429,7 @@ void __init smp_psurge_take_timebase(void)
 	set_dec(tb_ticks_per_jiffy/2);
 }
 
-void __init smp_psurge_give_timebase(void)
+static void __init smp_psurge_give_timebase(void)
 {
 	/* Nothing to do here */
 }
Signature · 1 line
2.39.2
#50 lore raw

PATCH 20/22 usb: fsl-mph-dr-of: mark fsl_usb2_mpc5121_init() static

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This function is only called locally and should always have been static:

drivers/usb/host/fsl-mph-dr-of.c:291:5: error: no previous prototype for 'fsl_usb2_mpc5121_init' [-Werror=missing-prototypes]

Fixes 230f7ede6c2f ("USB: add USB EHCI support for MPC5121 SoC")
---
 drivers/usb/host/fsl-mph-dr-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/fsl-mph-dr-of.c +1 -1
index 8508d37a2aff..6cdc3d805c32 100644
@@ -288,7 +288,7 @@ static void fsl_usb2_mph_dr_of_remove(struct platform_device *ofdev)
 #define PHYCTRL_LSFE		(1 << 1)	/* Line State Filter Enable */
 #define PHYCTRL_PXE		(1 << 0)	/* PHY oscillator enable */
 
-int fsl_usb2_mpc5121_init(struct platform_device *pdev)
+static int fsl_usb2_mpc5121_init(struct platform_device *pdev)
 {
 	struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
 	struct clk *clk;
Signature · 1 line
2.39.2
#52 lore raw

PATCH 21/22 fbdev/fsl-diu-fb: mark wr_reg_wa() static

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

wr_reg_wa() is not an appropriate name for a global function, and doesn't need to be global anyway, so mark it static and avoid the warning:

drivers/video/fbdev/fsl-diu-fb.c:493:6: error: no previous prototype for 'wr_reg_wa' [-Werror=missing-prototypes]

Fixes 0d9dab39fbbe ("powerpc/5121: fsl-diu-fb: fix issue with re-enabling DIU area descriptor")
---
 drivers/video/fbdev/fsl-diu-fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/fsl-diu-fb.c +1 -1
index 7fbd9f069ac2..0bced82fa494 100644
@@ -490,7 +490,7 @@ static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s)
  * Workaround for failed writing desc register of planes.
  * Needed with MPC5121 DIU rev 2.0 silicon.
  */
-void wr_reg_wa(u32 *reg, u32 val)
+static void wr_reg_wa(u32 *reg, u32 val)
 {
 	do {
 		out_be32(reg, val);
Signature · 1 line
2.39.2
#54 lore raw

PATCH 22/22 Makefile.extrawarn: turn on missing-prototypes globally

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Over the years we went from > 1000 of warnings to under 100 earlier this year, and I sent patches to address all the ones that I saw with compile testing randcom configs on arm64, arm and x86 kernels. This is a really useful warning, as it catches real bugs when there are mismatched prototypes. In particular with kernel control flow integrity enabled, those are no longer allowed.

I have done extensive testing to ensure that there are no new build errors or warnings on any configuration of x86, arm and arm64 builds. I also made sure that at least the both the normal defconfig and an allmodconfig build is clean for arc, csky, loongarch, m68k, microblaze, openrisc, parisc, powerpc, riscv, s390, and xtensa, with the respective maintainers doing most of the patches.

At this point, there are five architectures with a number of known
regressions: alpha, nios2, mips, sh and sparc. In the previous version of this patch, I had turned off the missing prototype warnings for the 15 architectures that still had issues, but since there are only five left, I think we can leave the rest to the maintainers (Cc'd here) as well.

---
 scripts/Makefile.extrawarn | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/Makefile.extrawarn +2 -2
index 2fe6f2828d37..c9725685aa76 100644
@@ -17,6 +17,8 @@ KBUILD_CFLAGS += -Wno-format-security
 KBUILD_CFLAGS += -Wno-trigraphs
 KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
 KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
+KBUILD_CFLAGS += -Wmissing-declarations
+KBUILD_CFLAGS += -Wmissing-prototypes
 
 ifneq ($(CONFIG_FRAME_WARN),0)
 KBUILD_CFLAGS += -Wframe-larger-than=$(CONFIG_FRAME_WARN)
@@ -95,10 +97,8 @@ export KBUILD_EXTRA_WARN
 ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),)
 
 KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter
-KBUILD_CFLAGS += -Wmissing-declarations
 KBUILD_CFLAGS += $(call cc-option, -Wrestrict)
 KBUILD_CFLAGS += -Wmissing-format-attribute
-KBUILD_CFLAGS += -Wmissing-prototypes
 KBUILD_CFLAGS += -Wold-style-definition
 KBUILD_CFLAGS += -Wmissing-include-dirs
 KBUILD_CFLAGS += $(call cc-option, -Wunused-but-set-variable)
Signature · 1 line
2.39.2
maintainer
#42 lore raw

Re: [PATCH 17/22] powerpc: ps3: move udbg_shutdown_ps3gelic prototype

In reply to Arnd Bergmann

Hi Arnd,

Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Allmodconfig kernels produce a missing-prototypes warning:

arch/powerpc/platforms/ps3/gelic_udbg.c:239:6: error: no previous prototype for 'udbg_shutdown_ps3gelic' [-Werror=missing-prototypes]

Move the declaration from a local header to asm/ps3.h where it can be seen from both the caller and the definition.

Quoted 6 lines
---
 arch/powerpc/include/asm/ps3.h               | 6 ++++++
 arch/powerpc/platforms/ps3/gelic_udbg.c      | 1 +
 drivers/net/ethernet/toshiba/ps3_gelic_net.h | 6 ------
 3 files changed, 7 insertions(+), 6 deletions(-)

Seems good to me. I'll test it next chance I get.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#29 lore raw

Re: [PATCH 15/22] arch: vdso: consolidate gettime prototypes

In reply to Arnd Bergmann

Hi Arnd,

Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :

Quoted 41 lines

From: Arnd Bergmann <[email protected]>

The VDSO functions are defined as globals in the kernel sources but intended to be called from userspace, so there is no need to declare them in a kernel side header.

Without a prototype, this now causes warnings such as

arch/mips/vdso/vgettimeofday.c:14:5: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes] arch/mips/vdso/vgettimeofday.c:28:5: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes] arch/mips/vdso/vgettimeofday.c:36:5: error: no previous prototype for '__vdso_clock_getres' [-Werror=missing-prototypes] arch/mips/vdso/vgettimeofday.c:42:5: error: no previous prototype for '__vdso_clock_gettime64' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:254:1: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:282:1: error: no previous prototype for '__vdso_clock_gettime_stick' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:307:1: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:343:1: error: no previous prototype for '__vdso_gettimeofday_stick' [-Werror=missing-prototypes]

Most architectures have already added workarounds for these by adding declarations somewhere, but since these are all compatible, we should really just have one copy, with an #ifdef check for the 32-bit vs 64-bit variant and use that everywhere.

Unfortunately, the sparc version is currently incompatible since that never added support for __vdso_clock_gettime64() in 32-bit userland. For the moment, I'm leaving this one out, as I can't easily test it and it requires a larger rework.

---
  arch/arm/include/asm/vdso.h              |  5 -----
  arch/arm/vdso/vgettimeofday.c            |  1 +
  arch/arm64/kernel/vdso32/vgettimeofday.c |  1 +
  arch/csky/kernel/vdso/vgettimeofday.c    | 11 +----------
  arch/loongarch/vdso/vgettimeofday.c      |  7 +------
  arch/mips/vdso/vgettimeofday.c           |  1 +
  arch/riscv/kernel/vdso/vgettimeofday.c   |  7 +------
  arch/x86/entry/vdso/vclock_gettime.c     | 10 +---------
  arch/x86/include/asm/vdso/gettimeofday.h |  2 --
  arch/x86/um/vdso/um_vdso.c               |  1 +
  include/vdso/gettime.h                   | 23 +++++++++++++++++++++++
  11 files changed, 31 insertions(+), 38 deletions(-)
Quoted 1 line

create mode 100644 include/vdso/gettime.h

powerpc has functions doing more or less the same, they are called __c_kernel_clock_gettime() and alike with their prototypes siting in arch/powerpc/include/asm/vdso/gettimeofday.h

Should those prototypes be moved to include/vdso/gettime.h too and eventually renamed, or are they considered too powerpc specific ?

Christophe

Applied
#12 lore raw

Re: (subset) [PATCH 06/22] [RESEND] stackleak: add declarations for global functions

In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

With -Wmissing-prototypes enabled, the stackleak code produces a couple of warnings that have no declarations because they are only called from assembler:

stackleak.c:127:25: error: no previous prototype for 'stackleak_erase' [-Werror=missing-prototypes] stackleak.c:139:25: error: no previous prototype for 'stackleak_erase_on_task_stack' [-Werror=missing-prototypes] stackleak.c:151:25: error: no previous prototype for 'stackleak_erase_off_task_stack' [-Werror=missing-prototypes] stackleak.c:159:49: error: no previous prototype for 'stackleak_track_stack' [-Werror=missing-prototypes]

[...]

Applied to for-next/hardening, thanks!

[06/22] stackleak: add declarations for global functions

        https://git.kernel.org/kees/c/65120498aaf8

Take care,

Signature · 1 line
Kees Cook
Reviewed-by on v2 9/22
#18 lore raw

Re: [PATCH 09/22] [v2] arch: fix asm-offsets.c building with -Wmissing-prototypes

In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When -Wmissing-prototypes is enabled, the some asm-offsets.c files fail to build, even when this warning is disabled in the Makefile for normal files:

arch/sparc/kernel/asm-offsets.c:22:5: error: no previous prototype for 'sparc32_foo' [-Werror=missing-prototypes] arch/sparc/kernel/asm-offsets.c:48:5: error: no previous prototype for 'foo' [-Werror=missing-prototypes]

Quoted 7 lines

Address this by making use of the same trick as x86, marking these functions as 'static __used' to avoid the need for a prototype by not drop them in dead-code elimination.

Looks good. I sometimes looks at sparc patches so I looked at this one.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#30 lore raw

Re: [PATCH 15/22] arch: vdso: consolidate gettime prototypes

In reply to Christophe Leroy
Quoted 8 lines · Christophe Leroy

Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :

powerpc has functions doing more or less the same, they are called __c_kernel_clock_gettime() and alike with their prototypes siting in arch/powerpc/include/asm/vdso/gettimeofday.h

Should those prototypes be moved to include/vdso/gettime.h too and eventually renamed, or are they considered too powerpc specific ?

I don't actually know, my initial interpretation was that these function names are part of the user ABI for the vdso, but I never looked closely enough at how vdso works to be sure what the actual ABI is.

If __c_kernel_clock_gettime() etc are not part of the user-facing ABI, I think renaming them for consistency with the other architectures would be best.

Arnd

#40 lore raw

Re: [PATCH 16/22] bcachefs: mark bch2_target_to_text_sb() static

In reply to Arnd Bergmann
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

bch2_target_to_text_sb() is only called in the file it is defined in, and it has no extern prototype:

fs/bcachefs/disk_groups.c:583:6: error: no previous prototype for 'bch2_target_to_text_sb' [-Werror=missing-prototypes]

Mark it static to avoid the warning and have the code better optimized.

Fixes bf0d9e89de2e ("bcachefs: Split apart bch2_target_to_text(), bch2_target_to_text_sb()")

This is already fixed in my tree.

#20 lore raw

Re: [PATCH 10/22] microblaze: include linux/cpu.h for trap_init() prototype

In reply to Arnd Bergmann

Hi Arnd,

Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Microblaze runs into a single -Wmissing-prototypes warning when that is enabled:

arch/microblaze/kernel/traps.c:21:6: warning: no previous prototype for 'trap_init' [-Wmissing-prototypes]

Include the right header to avoid this.

Thanks for your patch!

Quoted 5 lines
 arch/alpha/kernel/traps.c      | 1 +
 arch/csky/include/asm/traps.h  | 2 --
 arch/csky/kernel/traps.c       | 1 +
 arch/m68k/coldfire/vectors.c   | 3 +--
 arch/m68k/coldfire/vectors.h   | 3 ---

Ah, so this is where the m68k changes listed in the cover letter are hiding ;-)

Quoted 7 lines
 arch/microblaze/kernel/traps.c | 1 +
 arch/sparc/kernel/traps_32.c   | 1 +
 arch/sparc/kernel/traps_64.c   | 1 +
 arch/x86/include/asm/traps.h   | 1 -
 arch/x86/kernel/traps.c        | 1 +
 10 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 100644 arch/m68k/coldfire/vectors.h

Obviously the non-microblaze changes should be spun off in separate patches.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

#21 lore raw

Re: [PATCH 10/22] microblaze: include linux/cpu.h for trap_init() prototype

Quoted 32 lines · Geert Uytterhoeven
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Microblaze runs into a single -Wmissing-prototypes warning when that is enabled:

arch/microblaze/kernel/traps.c:21:6: warning: no previous prototype for 'trap_init' [-Wmissing-prototypes]

Include the right header to avoid this.

Thanks for your patch!

Quoted 5 lines
 arch/alpha/kernel/traps.c      | 1 +
 arch/csky/include/asm/traps.h  | 2 --
 arch/csky/kernel/traps.c       | 1 +
 arch/m68k/coldfire/vectors.c   | 3 +--
 arch/m68k/coldfire/vectors.h   | 3 ---

Ah, so this is where the m68k changes listed in the cover letter are hiding ;-)

Quoted 7 lines
 arch/microblaze/kernel/traps.c | 1 +
 arch/sparc/kernel/traps_32.c   | 1 +
 arch/sparc/kernel/traps_64.c   | 1 +
 arch/x86/include/asm/traps.h   | 1 -
 arch/x86/kernel/traps.c        | 1 +
 10 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 100644 arch/m68k/coldfire/vectors.h
Quoted 2 lines

Obviously the non-microblaze changes should be spun off in separate patches.

I messed up one of my rebases here and accidentally sent the wrong changelog text. My intention was to have the combined patch but with this text:

arch: include linux/cpu.h for trap_init() prototype

some architectures run into a -Wmissing-prototypes warning for trap_init()

arch/microblaze/kernel/traps.c:21:6: warning: no previous prototype for 'trap_init' [-Wmissing-prototypes]

Include the right header to avoid this consistently, removing the extra declarations on m68k and x86 that were added as local workarounds already.

I made the same mistake with the "arch: add do_page_fault prototypes" patch that was missing an explanation.

Arnd

#22 lore raw

Re: [PATCH 10/22] microblaze: include linux/cpu.h for trap_init() prototype

Hi Arnd,

Quoted 44 lines · Arnd Bergmann
Quoted 31 lines · Geert Uytterhoeven
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Microblaze runs into a single -Wmissing-prototypes warning when that is enabled:

arch/microblaze/kernel/traps.c:21:6: warning: no previous prototype for 'trap_init' [-Wmissing-prototypes]

Include the right header to avoid this.

Thanks for your patch!

Quoted 5 lines
 arch/alpha/kernel/traps.c      | 1 +
 arch/csky/include/asm/traps.h  | 2 --
 arch/csky/kernel/traps.c       | 1 +
 arch/m68k/coldfire/vectors.c   | 3 +--
 arch/m68k/coldfire/vectors.h   | 3 ---

Ah, so this is where the m68k changes listed in the cover letter are hiding ;-)

Quoted 7 lines
 arch/microblaze/kernel/traps.c | 1 +
 arch/sparc/kernel/traps_32.c   | 1 +
 arch/sparc/kernel/traps_64.c   | 1 +
 arch/x86/include/asm/traps.h   | 1 -
 arch/x86/kernel/traps.c        | 1 +
 10 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 100644 arch/m68k/coldfire/vectors.h
Quoted 2 lines

Obviously the non-microblaze changes should be spun off in separate patches.

I messed up one of my rebases here and accidentally sent the wrong changelog text. My intention was to have the combined patch but with this text:

arch: include linux/cpu.h for trap_init() prototype

some architectures run into a -Wmissing-prototypes warning for trap_init()

Quoted 7 lines

arch/microblaze/kernel/traps.c:21:6: warning: no previous prototype for 'trap_init' [-Wmissing-prototypes]

Include the right header to avoid this consistently, removing the extra declarations on m68k and x86 that were added as local workarounds already.

That makes sense, although it's hard to combine this with "my preference would be for the patches to make it through the respective subsystem maintainer trees"...

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#5 lore raw

Re: [PATCH 03/22] [RESEND] kprobes: unify kprobes_exceptions_nofify() prototypes

In reply to Arnd Bergmann
Quoted 11 lines · On Wed, 8 Nov 2023 13:58:24 +0100 Arnd Bergmann <[email protected]> wrote:

From: Arnd Bergmann <[email protected]>

Most architectures that support kprobes declare this function in their own asm/kprobes.h header and provide an override, but some are missing the prototype, which causes a warning for the __weak stub implementation:

kernel/kprobes.c:1865:12: error: no previous prototype for 'kprobe_exceptions_notify' [-Werror=missing-prototypes]
1865 | int __weak kprobe_exceptions_notify(struct notifier_block *self,

Move the prototype into linux/kprobes.h so it is visible to all the definitions.

Thanks, let me pick this to linux-trace tree.

Quoted 152 lines
---
 arch/arc/include/asm/kprobes.h     | 3 ---
 arch/arm/include/asm/kprobes.h     | 2 --
 arch/arm64/include/asm/kprobes.h   | 2 --
 arch/mips/include/asm/kprobes.h    | 2 --
 arch/powerpc/include/asm/kprobes.h | 2 --
 arch/s390/include/asm/kprobes.h    | 2 --
 arch/sh/include/asm/kprobes.h      | 2 --
 arch/sparc/include/asm/kprobes.h   | 2 --
 arch/x86/include/asm/kprobes.h     | 2 --
 include/linux/kprobes.h            | 4 ++++
 10 files changed, 4 insertions(+), 19 deletions(-)
arch/arc/include/asm/kprobes.h +0 -3
index de1566e32cb8..68e8301c0df2 100644
@@ -32,9 +32,6 @@ struct kprobe;
 
 void arch_remove_kprobe(struct kprobe *p);
 
-int kprobe_exceptions_notify(struct notifier_block *self,
-			     unsigned long val, void *data);
-
 struct prev_kprobe {
 	struct kprobe *kp;
 	unsigned long status;
arch/arm/include/asm/kprobes.h +0 -2
index e26a278d301a..5b8dbf1b0be4 100644
@@ -40,8 +40,6 @@ struct kprobe_ctlblk {
 
 void arch_remove_kprobe(struct kprobe *);
 int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
-int kprobe_exceptions_notify(struct notifier_block *self,
-			     unsigned long val, void *data);
 
 /* optinsn template addresses */
 extern __visible kprobe_opcode_t optprobe_template_entry[];
arch/arm64/include/asm/kprobes.h +0 -2
index 05cd82eeca13..be7a3680dadf 100644
@@ -37,8 +37,6 @@ struct kprobe_ctlblk {
 
 void arch_remove_kprobe(struct kprobe *);
 int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
-int kprobe_exceptions_notify(struct notifier_block *self,
-			     unsigned long val, void *data);
 void __kretprobe_trampoline(void);
 void __kprobes *trampoline_probe_handler(struct pt_regs *regs);
 
arch/mips/include/asm/kprobes.h +0 -2
index 68b1e5d458cf..bc27d99c9436 100644
@@ -71,8 +71,6 @@ struct kprobe_ctlblk {
 	struct prev_kprobe prev_kprobe;
 };
 
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-				    unsigned long val, void *data);
 
 #endif /* CONFIG_KPROBES */
 #endif /* _ASM_KPROBES_H */
arch/powerpc/include/asm/kprobes.h +0 -2
index c8e4b4fd4e33..4525a9c68260 100644
@@ -84,8 +84,6 @@ struct arch_optimized_insn {
 	kprobe_opcode_t *insn;
 };
 
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-					unsigned long val, void *data);
 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
 extern int kprobe_handler(struct pt_regs *regs);
 extern int kprobe_post_handler(struct pt_regs *regs);
arch/s390/include/asm/kprobes.h +0 -2
index 21b9e5290c04..01f1682a73b7 100644
@@ -73,8 +73,6 @@ struct kprobe_ctlblk {
 void arch_remove_kprobe(struct kprobe *p);
 
 int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
-int kprobe_exceptions_notify(struct notifier_block *self,
-	unsigned long val, void *data);
 
 #define flush_insn_slot(p)	do { } while (0)
 
arch/sh/include/asm/kprobes.h +0 -2
index eeba83e0a7d2..65d4c3316a5b 100644
@@ -46,8 +46,6 @@ struct kprobe_ctlblk {
 };
 
 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-				    unsigned long val, void *data);
 extern int kprobe_handle_illslot(unsigned long pc);
 #else
 
arch/sparc/include/asm/kprobes.h +0 -2
index 06c2bc767ef7..aec742cd898f 100644
@@ -47,8 +47,6 @@ struct kprobe_ctlblk {
 	struct prev_kprobe prev_kprobe;
 };
 
-int kprobe_exceptions_notify(struct notifier_block *self,
-			     unsigned long val, void *data);
 int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
 asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
 				      struct pt_regs *regs);
arch/x86/include/asm/kprobes.h +0 -2
index a2e9317aad49..5939694dfb28 100644
@@ -113,8 +113,6 @@ struct kprobe_ctlblk {
 };
 
 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-				    unsigned long val, void *data);
 extern int kprobe_int3_handler(struct pt_regs *regs);
 
 #else
include/linux/kprobes.h +4 -0
index 365eb092e9c4..ab1da3142b06 100644
@@ -445,6 +445,10 @@ int kprobe_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
 
 int arch_kprobe_get_kallsym(unsigned int *symnum, unsigned long *value,
 			    char *type, char *sym);
+
+int kprobe_exceptions_notify(struct notifier_block *self,
+			     unsigned long val, void *data);
+
 #else /* !CONFIG_KPROBES: */
 
 static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
Signature · 1 line
2.39.2
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
#44 lore raw

Re: [PATCH 17/22] powerpc: ps3: move udbg_shutdown_ps3gelic prototype

In reply to Arnd Bergmann
kernel test robot noticed the following build errors:

Hi Arnd,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on next-20231108]
[cannot apply to v6.6]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Arnd-Bergmann/ida-make-ida_dump-static/20231109-005742
base:   linus/master
patch link:    https://lore.kernel.org/r/20231108125843.3806765-18-arnd%40kernel.org
patch subject: [PATCH 17/22] powerpc: ps3: move udbg_shutdown_ps3gelic prototype
config: powerpc64-randconfig-001-20231109 (https://download.01.org/0day-ci/archive/20231109/[email protected]/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231109/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

arch/powerpc/platforms/ps3/gelic_udbg.c:59:1: warning: alignment 1 of 'struct debug_block' is less than 32 [-Wpacked-not-aligned]

      59 | } __packed;
         | ^
>> arch/powerpc/platforms/ps3/gelic_udbg.c:240:6: error: redefinition of 'udbg_shutdown_ps3gelic'
     240 | void udbg_shutdown_ps3gelic(void)
         |      ^~~~~~~~~~~~~~~~~~~~~~
   In file included from arch/powerpc/platforms/ps3/gelic_udbg.c:17:
   arch/powerpc/include/asm/ps3.h:520:20: note: previous definition of 'udbg_shutdown_ps3gelic' with type 'void(void)'
     520 | static inline void udbg_shutdown_ps3gelic(void) {}
         |                    ^~~~~~~~~~~~~~~~~~~~~~

vim +/udbg_shutdown_ps3gelic +240 arch/powerpc/platforms/ps3/gelic_udbg.c

c26afe9e8591f3 Hector Martin 2011-08-31 239
c26afe9e8591f3 Hector Martin 2011-08-31 @240 void udbg_shutdown_ps3gelic(void)

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Reviewed-by on v1 2/22
#3 lore raw

Re: [PATCH 02/22] [RESEND^2] jffs2: mark __jffs2_dbg_superblock_counts() static

In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This function is only called locally and does not need to be global. Since there is no external prototype, gcc warns about the non-static definition:

Quoted 7 lines

fs/jffs2/debug.c:160:6: error: no previous prototype for '__jffs2_dbg_superblock_counts' [-Werror=missing-prototypes]

---
  fs/jffs2/debug.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
#31 lore raw

Re: [PATCH 15/22] arch: vdso: consolidate gettime prototypes

In reply to Arnd Bergmann

Le 08/11/2023 à 20:37, Arnd Bergmann a écrit :

Quoted 10 lines · Christophe Leroy
Quoted 8 lines

Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :

powerpc has functions doing more or less the same, they are called __c_kernel_clock_gettime() and alike with their prototypes siting in arch/powerpc/include/asm/vdso/gettimeofday.h

Should those prototypes be moved to include/vdso/gettime.h too and eventually renamed, or are they considered too powerpc specific ?

Quoted 9 lines

I don't actually know, my initial interpretation was that these function names are part of the user ABI for the vdso, but I never looked closely enough at how vdso works to be sure what the actual ABI is.

If __c_kernel_clock_gettime() etc are not part of the user-facing ABI, I think renaming them for consistency with the other architectures would be best.

User-facing ABI function is __kernel_clock_gettime(), defined in arch/powerpc/kernel/vdso/gettimeofday.S , see man vdso. There is no prototype defined for it anywhere, obviously that's undetected because it is assembly. Should a prototype be added somewhere anyway ?

__kernel_clock_gettime() sets up a stack frame, retrieves the address of the datapage then calls __c_kernel_clock_gettime() which then calls __cvdso_clock_gettime_data() which is part of the generic CVDSO.

Maybe that's too different from what other architectures do ?

Christophe

#35 lore raw

Re: [PATCH 15/22] arch: vdso: consolidate gettime prototypes

In reply to Arnd Bergmann
kernel test robot noticed the following build errors:

Hi Arnd,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[cannot apply to v6.6 next-20231109]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Arnd-Bergmann/ida-make-ida_dump-static/20231109-005742
base:   linus/master
patch link:    https://lore.kernel.org/r/20231108125843.3806765-16-arnd%40kernel.org
patch subject: [PATCH 15/22] arch: vdso: consolidate gettime prototypes
config: um-defconfig (https://download.01.org/0day-ci/archive/20231109/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231109/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> arch/x86/um/vdso/um_vdso.c:17:5: error: conflicting types for '__vdso_clock_gettime'; have 'int(clockid_t,  struct __kernel_old_timespec *)' {aka 'int(int,  struct __kernel_old_timespec *)'}
      17 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
         |     ^~~~~~~~~~~~~~~~~~~~
   In file included from arch/x86/um/vdso/um_vdso.c:15:
   include/vdso/gettime.h:16:5: note: previous declaration of '__vdso_clock_gettime' with type 'int(clockid_t,  struct __kernel_timespec *)' {aka 'int(int,  struct __kernel_timespec *)'}
      16 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
         |     ^~~~~~~~~~~~~~~~~~~~

arch/x86/um/vdso/um_vdso.c:58:1: warning: no previous prototype for '__vdso_getcpu' [-Wmissing-prototypes]
58 | __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
| ^~~~~~~~~~~~~

vim +17 arch/x86/um/vdso/um_vdso.c

f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25 16

82210fc778982d arch/x86/um/vdso/um_vdso.c        Arnd Bergmann      2019-10-27 @17  int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  18  {
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  19  	long ret;
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  20  
5541992e512de8 arch/x86/um/vdso/um_vdso.c        Ammar Faizi        2022-12-24  21  	asm("syscall"
5541992e512de8 arch/x86/um/vdso/um_vdso.c        Ammar Faizi        2022-12-24  22  		: "=a" (ret)
5541992e512de8 arch/x86/um/vdso/um_vdso.c        Ammar Faizi        2022-12-24  23  		: "0" (__NR_clock_gettime), "D" (clock), "S" (ts)
5541992e512de8 arch/x86/um/vdso/um_vdso.c        Ammar Faizi        2022-12-24  24  		: "rcx", "r11", "memory");
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  25  
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  26  	return ret;
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  27  }
82210fc778982d arch/x86/um/vdso/um_vdso.c        Arnd Bergmann      2019-10-27  28  int clock_gettime(clockid_t, struct __kernel_old_timespec *)
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  29  	__attribute__((weak, alias("__vdso_clock_gettime")));
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  30  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#36 lore raw

Re: [PATCH 15/22] arch: vdso: consolidate gettime prototypes

In reply to Arnd Bergmann
kernel test robot noticed the following build errors:

Hi Arnd,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[cannot apply to v6.6 next-20231109]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Arnd-Bergmann/ida-make-ida_dump-static/20231109-005742
base:   linus/master
patch link:    https://lore.kernel.org/r/20231108125843.3806765-16-arnd%40kernel.org
patch subject: [PATCH 15/22] arch: vdso: consolidate gettime prototypes
config: um-allnoconfig (https://download.01.org/0day-ci/archive/20231109/[email protected]/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231109/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> arch/x86/um/vdso/um_vdso.c:17:5: error: conflicting types for '__vdso_clock_gettime'
      17 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
         |     ^
   include/vdso/gettime.h:16:5: note: previous declaration is here
      16 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
         |     ^
   arch/x86/um/vdso/um_vdso.c:58:1: warning: no previous prototype for function '__vdso_getcpu' [-Wmissing-prototypes]
      58 | __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
         | ^
   arch/x86/um/vdso/um_vdso.c:57:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
      57 | long
         | ^
         | static 

1 warning and 1 error generated.

vim +/__vdso_clock_gettime +17 arch/x86/um/vdso/um_vdso.c

f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25 16

82210fc778982d arch/x86/um/vdso/um_vdso.c        Arnd Bergmann      2019-10-27 @17  int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  18  {
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  19  	long ret;
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  20  
5541992e512de8 arch/x86/um/vdso/um_vdso.c        Ammar Faizi        2022-12-24  21  	asm("syscall"
5541992e512de8 arch/x86/um/vdso/um_vdso.c        Ammar Faizi        2022-12-24  22  		: "=a" (ret)
5541992e512de8 arch/x86/um/vdso/um_vdso.c        Ammar Faizi        2022-12-24  23  		: "0" (__NR_clock_gettime), "D" (clock), "S" (ts)
5541992e512de8 arch/x86/um/vdso/um_vdso.c        Ammar Faizi        2022-12-24  24  		: "rcx", "r11", "memory");
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  25  
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  26  	return ret;
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  27  }
82210fc778982d arch/x86/um/vdso/um_vdso.c        Arnd Bergmann      2019-10-27  28  int clock_gettime(clockid_t, struct __kernel_old_timespec *)
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  29  	__attribute__((weak, alias("__vdso_clock_gettime")));
f1c2bb8b9964ed arch/um/sys-x86_64/vdso/um_vdso.c Richard Weinberger 2011-07-25  30  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#32 lore raw

Re: [PATCH 15/22] arch: vdso: consolidate gettime prototypes

In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann
Quoted 6 lines · Christophe Leroy

Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :

powerpc has functions doing more or less the same, they are called __c_kernel_clock_gettime() and alike with their prototypes siting in arch/powerpc/include/asm/vdso/gettimeofday.h

Quoted 7 lines
Quoted 2 lines

Should those prototypes be moved to include/vdso/gettime.h too and eventually renamed, or are they considered too powerpc specific ?

I don't actually know, my initial interpretation was that these function names are part of the user ABI for the vdso, but I never looked closely enough at how vdso works to be sure what the actual ABI is.

AFAIK the ABI is just the symbols we export, as defined in the linker script:

/*
* This controls what symbols we export from the DSO. */
VERSION

{
	VDSO_VERSION_STRING {
	global:
		__kernel_get_syscall_map;
		__kernel_gettimeofday;
		__kernel_clock_gettime;
		__kernel_clock_getres;
		__kernel_get_tbfreq;
		__kernel_sync_dicache;
		__kernel_sigtramp_rt64;
		__kernel_getcpu;
		__kernel_time;

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/vdso/vdso64.lds.S?h=v6.6&#n117

Quoted 3 lines

If __c_kernel_clock_gettime() etc are not part of the user-facing ABI, I think renaming them for consistency with the other architectures would be best.

The __c symbols are not part of the ABI, so we could rename them.

At the moment though they don't have the same prototype as the generic versions, because we find the VDSO data in asm and pass it to the C functions, eg:

int __c_kernel_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz,

			    const struct vdso_data *vd);

I think we can rework that though, by implementing __arch_get_vdso_data() and getting the vdso_data in C. Then we'd be able to share the prototypes.

cheers

#33 lore raw

Re: [PATCH 15/22] arch: vdso: consolidate gettime prototypes

Le 09/11/2023 à 11:18, Michael Ellerman a écrit :

Quoted 48 lines
Quoted 7 lines · Arnd Bergmann
Quoted 6 lines · Christophe Leroy

Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :

powerpc has functions doing more or less the same, they are called __c_kernel_clock_gettime() and alike with their prototypes siting in arch/powerpc/include/asm/vdso/gettimeofday.h

Quoted 7 lines
Quoted 2 lines

Should those prototypes be moved to include/vdso/gettime.h too and eventually renamed, or are they considered too powerpc specific ?

I don't actually know, my initial interpretation was that these function names are part of the user ABI for the vdso, but I never looked closely enough at how vdso works to be sure what the actual ABI is.

AFAIK the ABI is just the symbols we export, as defined in the linker script:

/*
* This controls what symbols we export from the DSO. */
VERSION

{
	VDSO_VERSION_STRING {
	global:
		__kernel_get_syscall_map;
		__kernel_gettimeofday;
		__kernel_clock_gettime;
		__kernel_clock_getres;
		__kernel_get_tbfreq;
		__kernel_sync_dicache;
		__kernel_sigtramp_rt64;
		__kernel_getcpu;
		__kernel_time;

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/vdso/vdso64.lds.S?h=v6.6&#n117

Quoted 3 lines

If __c_kernel_clock_gettime() etc are not part of the user-facing ABI, I think renaming them for consistency with the other architectures would be best.

The __c symbols are not part of the ABI, so we could rename them.

At the moment though they don't have the same prototype as the generic versions, because we find the VDSO data in asm and pass it to the C functions, eg:

Quoted 6 lines

int __c_kernel_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz,

			    const struct vdso_data *vd);

I think we can rework that though, by implementing __arch_get_vdso_data() and getting the vdso_data in C. Then we'd be able to share the prototypes.

I think it would not a been good idea, it would be less performant, for explanation see commit
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e876f0b69dc993e86ca7795e63e98385aa9a7ef3

Christophe

#34 lore raw

Re: [PATCH 15/22] arch: vdso: consolidate gettime prototypes

Quoted 52 lines · Christophe Leroy

Le 09/11/2023 à 11:18, Michael Ellerman a écrit :

Quoted 51 lines
Quoted 7 lines · Arnd Bergmann
Quoted 6 lines · Christophe Leroy

Le 08/11/2023 à 13:58, Arnd Bergmann a écrit :

powerpc has functions doing more or less the same, they are called __c_kernel_clock_gettime() and alike with their prototypes siting in arch/powerpc/include/asm/vdso/gettimeofday.h

Quoted 7 lines
Quoted 2 lines

Should those prototypes be moved to include/vdso/gettime.h too and eventually renamed, or are they considered too powerpc specific ?

I don't actually know, my initial interpretation was that these function names are part of the user ABI for the vdso, but I never looked closely enough at how vdso works to be sure what the actual ABI is.

AFAIK the ABI is just the symbols we export, as defined in the linker script:

/*
* This controls what symbols we export from the DSO. */
VERSION

{
	VDSO_VERSION_STRING {
	global:
		__kernel_get_syscall_map;
		__kernel_gettimeofday;
		__kernel_clock_gettime;
		__kernel_clock_getres;
		__kernel_get_tbfreq;
		__kernel_sync_dicache;
		__kernel_sigtramp_rt64;
		__kernel_getcpu;
		__kernel_time;

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/vdso/vdso64.lds.S?h=v6.6&#n117

Quoted 3 lines

If __c_kernel_clock_gettime() etc are not part of the user-facing ABI, I think renaming them for consistency with the other architectures would be best.

The __c symbols are not part of the ABI, so we could rename them.

At the moment though they don't have the same prototype as the generic versions, because we find the VDSO data in asm and pass it to the C functions, eg:

int __c_kernel_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz,

			    const struct vdso_data *vd);
Quoted 7 lines
Quoted 3 lines

I think we can rework that though, by implementing __arch_get_vdso_data() and getting the vdso_data in C. Then we'd be able to share the prototypes.

I think it would not a been good idea, it would be less performant, for explanation see commit
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e876f0b69dc993e86ca7795e63e98385aa9a7ef3

Ah thanks. I was wondering why you had done it in asm.

It's a pity but you're right that's probably a measurable performance hit for some of those calls.

cheers

#45 lore raw

Re: [PATCH 17/22] powerpc: ps3: move udbg_shutdown_ps3gelic prototype

In reply to kernel test robot
Quoted 29 lines · kernel test robot

Hi Arnd,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on next-20231108]
[cannot apply to v6.6]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Arnd-Bergmann/ida-make-ida_dump-static/20231109-005742
base:   linus/master
patch link:    https://lore.kernel.org/r/20231108125843.3806765-18-arnd%40kernel.org
patch subject: [PATCH 17/22] powerpc: ps3: move udbg_shutdown_ps3gelic prototype
config: powerpc64-randconfig-001-20231109 (https://download.01.org/0day-ci/archive/20231109/[email protected]/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231109/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

   arch/powerpc/platforms/ps3/gelic_udbg.c:59:1: warning: alignment 1 of 'struct debug_block' is less than 32 [-Wpacked-not-aligned]
      59 | } __packed;
         | ^
Quoted 7 lines
Quoted 1 line
Quoted 1 line

arch/powerpc/platforms/ps3/gelic_udbg.c:240:6: error: redefinition of 'udbg_shutdown_ps3gelic'

240 | void udbg_shutdown_ps3gelic(void)
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from arch/powerpc/platforms/ps3/gelic_udbg.c:17:

   arch/powerpc/include/asm/ps3.h:520:20: note: previous definition of 'udbg_shutdown_ps3gelic' with type 'void(void)'
     520 | static inline void udbg_shutdown_ps3gelic(void) {}
         |                    ^~~~~~~~~~~~~~~~~~~~~~

As pointed out by Arnd this is due to there being two symbols that control the gelic_udbg.c code.

I don't see the need for PS3GELIC_UDBG, without PPC_EARLY_DEBUG_PS3GELIC it just causes gelic_udbg.c to be built, but never called.

The diff below fixes the error AFAICS.

I can just fold it in if you're happy with that Arnd.

arch/powerpc/Kconfig.debug +0 -1
index ea4033abc07d..8c80b154e814 100644
@@ -271,7 +271,6 @@ config PPC_EARLY_DEBUG_USBGECKO
 config PPC_EARLY_DEBUG_PS3GELIC
 	bool "Early debugging through the PS3 Ethernet port"
 	depends on PPC_PS3
-	select PS3GELIC_UDBG
 	help
 	  Select this to enable early debugging for the PlayStation3 via
 	  UDP broadcasts sent out through the Ethernet port.
arch/powerpc/platforms/ps3/Kconfig +0 -12
index a44869e5ea70..e9c1087dd42e 100644
@@ -167,16 +167,4 @@ config PS3_LPM
 	  profiling support of the Cell processor with programs like
 	  perfmon2, then say Y or M, otherwise say N.
 
-config PS3GELIC_UDBG
-	bool "PS3 udbg output via UDP broadcasts on Ethernet"
-	depends on PPC_PS3
-	help
-	  Enables udbg early debugging output by sending broadcast UDP
-	  via the Ethernet port (UDP port number 18194).
-
-	  This driver uses a trivial implementation and is independent
-	  from the main PS3 gelic network driver.
-
-	  If in doubt, say N here.
-
 endmenu
arch/powerpc/platforms/ps3/Makefile +1 -1
index 86bf2967a8d4..bc79bb124d1e 100644
@@ -3,7 +3,7 @@ obj-y += setup.o mm.o time.o hvcall.o htab.o repository.o
 obj-y += interrupt.o exports.o os-area.o
 obj-y += system-bus.o
 
-obj-$(CONFIG_PS3GELIC_UDBG) += gelic_udbg.o
+obj-$(CONFIG_PPC_EARLY_DEBUG_PS3GELIC) += gelic_udbg.o
 obj-$(CONFIG_SMP) += smp.o
 obj-$(CONFIG_SPU_BASE) += spu.o
 obj-y += device-init.o

cheers

#46 lore raw

Re: [PATCH 17/22] powerpc: ps3: move udbg_shutdown_ps3gelic prototype

Quoted 9 lines · Michael Ellerman

As pointed out by Arnd this is due to there being two symbols that control the gelic_udbg.c code.

I don't see the need for PS3GELIC_UDBG, without PPC_EARLY_DEBUG_PS3GELIC it just causes gelic_udbg.c to be built, but never called.

The diff below fixes the error AFAICS.

I can just fold it in if you're happy with that Arnd.

Yes, looks good to me, please do.

Arnd

maintainer Reviewed-by on v1 15/22
#37 lore raw

Re: [PATCH 15/22] arch: vdso: consolidate gettime prototypes

In reply to Arnd Bergmann

Hi Arnd,

Quoted 17 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The VDSO functions are defined as globals in the kernel sources but intended to be called from userspace, so there is no need to declare them in a kernel side header.

Without a prototype, this now causes warnings such as

arch/mips/vdso/vgettimeofday.c:14:5: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes] arch/mips/vdso/vgettimeofday.c:28:5: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes] arch/mips/vdso/vgettimeofday.c:36:5: error: no previous prototype for '__vdso_clock_getres' [-Werror=missing-prototypes] arch/mips/vdso/vgettimeofday.c:42:5: error: no previous prototype for '__vdso_clock_gettime64' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:254:1: error: no previous prototype for '__vdso_clock_gettime' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:282:1: error: no previous prototype for '__vdso_clock_gettime_stick' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:307:1: error: no previous prototype for '__vdso_gettimeofday' [-Werror=missing-prototypes] arch/sparc/vdso/vclock_gettime.c:343:1: error: no previous prototype for '__vdso_gettimeofday_stick' [-Werror=missing-prototypes]

Quoted 5 lines

Most architectures have already added workarounds for these by adding declarations somewhere, but since these are all compatible, we should really just have one copy, with an #ifdef check for the 32-bit vs 64-bit variant and use that everywhere.

I agree, it is a good idea to have a single header for this purpose.

Quoted 6 lines

Unfortunately, the sparc version is currently incompatible since that never added support for __vdso_clock_gettime64() in 32-bit userland. For the moment, I'm leaving this one out, as I can't easily test it and it requires a larger rework.

Quoted 259 lines
---
 arch/arm/include/asm/vdso.h              |  5 -----
 arch/arm/vdso/vgettimeofday.c            |  1 +
 arch/arm64/kernel/vdso32/vgettimeofday.c |  1 +
 arch/csky/kernel/vdso/vgettimeofday.c    | 11 +----------
 arch/loongarch/vdso/vgettimeofday.c      |  7 +------
 arch/mips/vdso/vgettimeofday.c           |  1 +
 arch/riscv/kernel/vdso/vgettimeofday.c   |  7 +------
 arch/x86/entry/vdso/vclock_gettime.c     | 10 +---------
 arch/x86/include/asm/vdso/gettimeofday.h |  2 --
 arch/x86/um/vdso/um_vdso.c               |  1 +
 include/vdso/gettime.h                   | 23 +++++++++++++++++++++++
 11 files changed, 31 insertions(+), 38 deletions(-)
 create mode 100644 include/vdso/gettime.h
arch/arm/include/asm/vdso.h +0 -5
index 422c3afa806a..5b85889f82ee 100644
@@ -24,11 +24,6 @@ static inline void arm_install_vdso(struct mm_struct *mm, unsigned long addr)
 
 #endif /* CONFIG_VDSO */
 
-int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts);
-int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts);
-int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
-int __vdso_clock_getres(clockid_t clock_id, struct old_timespec32 *res);
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
arch/arm/vdso/vgettimeofday.c +1 -0
index a003beacac76..3554aa35f1ba 100644
@@ -8,6 +8,7 @@
 #include <linux/types.h>
 #include <asm/vdso.h>
 #include <asm/unwind.h>
+#include <vdso/gettime.h>
 
 int __vdso_clock_gettime(clockid_t clock,
 			 struct old_timespec32 *ts)
arch/arm64/kernel/vdso32/vgettimeofday.c +1 -0
index 5acff29c5991..e23c7f4ef26b 100644
@@ -5,6 +5,7 @@
  * Copyright (C) 2018 ARM Limited
  *
  */
+#include <vdso/gettime.h>
 
 int __vdso_clock_gettime(clockid_t clock,
 			 struct old_timespec32 *ts)
arch/csky/kernel/vdso/vgettimeofday.c +1 -10
index c4831145eed5..55af30e83752 100644
@@ -2,36 +2,27 @@
 
 #include <linux/time.h>
 #include <linux/types.h>
+#include <vdso/gettime.h>
 
 extern
-int __vdso_clock_gettime(clockid_t clock,
-			 struct old_timespec32 *ts);
 int __vdso_clock_gettime(clockid_t clock,
 			 struct old_timespec32 *ts)
 {
 	return __cvdso_clock_gettime32(clock, ts);
 }
 
-int __vdso_clock_gettime64(clockid_t clock,
-			   struct __kernel_timespec *ts);
 int __vdso_clock_gettime64(clockid_t clock,
 			   struct __kernel_timespec *ts)
 {
 	return __cvdso_clock_gettime(clock, ts);
 }
 
-extern
-int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
-			struct timezone *tz);
 int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
 			struct timezone *tz)
 {
 	return __cvdso_gettimeofday(tv, tz);
 }
 
-extern
-int __vdso_clock_getres(clockid_t clock_id,
-			struct old_timespec32 *res);
 int __vdso_clock_getres(clockid_t clock_id,
 			struct old_timespec32 *res)
 {
arch/loongarch/vdso/vgettimeofday.c +1 -6
index 8f22863bd7ea..0885c1f3a89d 100644
@@ -5,23 +5,18 @@
  * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  */
 #include <linux/types.h>
+#include <vdso/gettime.h>
 
-extern
-int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
 int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
 {
 	return __cvdso_clock_gettime(clock, ts);
 }
 
-extern
-int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
 {
 	return __cvdso_gettimeofday(tv, tz);
 }
 
-extern
-int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res);
 int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res)
 {
 	return __cvdso_clock_getres(clock_id, res);
arch/mips/vdso/vgettimeofday.c +1 -0
index 6b83b6376a4b..604afea3f336 100644
@@ -9,6 +9,7 @@
  */
 #include <linux/time.h>
 #include <linux/types.h>
+#include <vdso/gettime.h>
 
 #if _MIPS_SIM != _MIPS_SIM_ABI64
 int __vdso_clock_gettime(clockid_t clock,
arch/riscv/kernel/vdso/vgettimeofday.c +1 -6
index cc0d80699c31..b35057802584 100644
@@ -8,23 +8,18 @@
 
 #include <linux/time.h>
 #include <linux/types.h>
+#include <vdso/gettime.h>
 
-extern
-int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
 int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
 {
 	return __cvdso_clock_gettime(clock, ts);
 }
 
-extern
-int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
 {
 	return __cvdso_gettimeofday(tv, tz);
 }
 
-extern
-int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res);
 int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res)
 {
 	return __cvdso_clock_getres(clock_id, res);
arch/x86/entry/vdso/vclock_gettime.c +1 -9
index 7d70935b6758..0debc194bd78 100644
@@ -11,12 +11,10 @@
 #include <linux/time.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
+#include <vdso/gettime.h>
 
 #include "../../../../lib/vdso/gettimeofday.c"
 
-extern int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
-extern __kernel_old_time_t __vdso_time(__kernel_old_time_t *t);
-
 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
 {
 	return __cvdso_gettimeofday(tv, tz);
@@ -35,9 +33,6 @@ __kernel_old_time_t time(__kernel_old_time_t *t)	__attribute__((weak, alias("__v
 
 #if defined(CONFIG_X86_64) && !defined(BUILD_VDSO32_64)
 /* both 64-bit and x32 use these */
-extern int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
-extern int __vdso_clock_getres(clockid_t clock, struct __kernel_timespec *res);
-
 int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
 {
 	return __cvdso_clock_gettime(clock, ts);
@@ -56,9 +51,6 @@ int clock_getres(clockid_t, struct __kernel_timespec *)
 
 #else
 /* i386 only */
-extern int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts);
-extern int __vdso_clock_getres(clockid_t clock, struct old_timespec32 *res);
-
 int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts)
 {
 	return __cvdso_clock_gettime32(clock, ts);
arch/x86/include/asm/vdso/gettimeofday.h +0 -2
index c81858d903dc..a46edb0e0cf7 100644
@@ -337,8 +337,6 @@ u64 vdso_calc_delta(u64 cycles, u64 last, u64 mask, u32 mult)
 }
 #define vdso_calc_delta vdso_calc_delta
 
-int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts);
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_VDSO_GETTIMEOFDAY_H */
arch/x86/um/vdso/um_vdso.c +1 -0
index ff0f3b4b6c45..63768dd347ce 100644
@@ -12,6 +12,7 @@
 #include <linux/time.h>
 #include <linux/getcpu.h>
 #include <asm/unistd.h>
+#include <vdso/gettime.h>
 
 int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
 {
include/vdso/gettime.h new file +23 -0
new file mode 100644
index 000000000000..c50d152e7b3e
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _VDSO_GETTIME_H
+#define _VDSO_GETTIME_H
+
+#include <linux/types.h>
+
+struct __kernel_timespec;
+struct timezone;
+
+#if !defined(CONFIG_64BIT) || defined(BUILD_VDSO32_64)
+struct old_timespec32;
+int __vdso_clock_getres(clockid_t clock, struct old_timespec32 *res);
+int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts);
+#else
+int __vdso_clock_getres(clockid_t clock, struct __kernel_timespec *res);
+int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
+#endif
+
+__kernel_old_time_t __vdso_time(__kernel_old_time_t *t);
+int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
+int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts);
+
+#endif
Signature · 2 lines
Regards,
Vincenzo
Reviewed-by on v1 4/22
#7 lore raw

Re: [PATCH 04/22] [RESEND] time: make sysfs_get_uname() function visible in header

In reply to Arnd Bergmann

Hello Arnd,

Quoted 4 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This function is defined globally in clocksource.c and used conditionally in clockevent.c, which the declaration hidden when clockevent support

s/which/with/ ?

Quoted 8 lines

is disabled. This causes a harmless warning in the definition:

kernel/time/clocksource.c:1324:9: warning: no previous prototype for 'sysfs_get_uname' [-Wmissing-prototypes]
1324 | ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt)

Move the declaration out of the #ifdef so it is always visible.

Other than that:

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
maintainer Applied
#53 lore raw

Re: [PATCH 21/22] fbdev/fsl-diu-fb: mark wr_reg_wa() static

In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

wr_reg_wa() is not an appropriate name for a global function, and doesn't need to be global anyway, so mark it static and avoid the warning:

drivers/video/fbdev/fsl-diu-fb.c:493:6: error: no previous prototype for 'wr_reg_wa' [-Werror=missing-prototypes]

Fixes 0d9dab39fbbe ("powerpc/5121: fsl-diu-fb: fix issue with re-enabling DIU area descriptor")

applied this patch to the fbdev git tree.

Thanks!
Helge

Quoted 17 lines
---
  drivers/video/fbdev/fsl-diu-fb.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/fsl-diu-fb.c +1 -1
index 7fbd9f069ac2..0bced82fa494 100644
@@ -490,7 +490,7 @@ static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s)
   * Workaround for failed writing desc register of planes.
   * Needed with MPC5121 DIU rev 2.0 silicon.
   */
-void wr_reg_wa(u32 *reg, u32 val)
+static void wr_reg_wa(u32 *reg, u32 val)
  {
  	do {
  		out_be32(reg, val);
maintainer
#10 lore raw

Re: [PATCH 05/22] [RESEND] parport: gsc: mark init function static

In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This is only used locally, so mark it static to avoid a warning:

drivers/parport/parport_gsc.c:395:5: error: no previous prototype for 'parport_gsc_init' [-Werror=missing-prototypes]

Since the parport_gsc driver is only used on parisc machines, I've added this patch to the parisc git tree.

Thanks!
Helge

Quoted 17 lines
---
  drivers/parport/parport_gsc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parport/parport_gsc.c +1 -1
index 5e4475254bd0..c7e18382dc01 100644
@@ -392,7 +392,7 @@ static struct parisc_driver parport_driver __refdata = {
  	.remove		= __exit_p(parport_remove_chip),
  };
 
-int parport_gsc_init(void)
+static int parport_gsc_init(void)
  {
  	return register_parisc_driver(&parport_driver);
  }
maintainer Reviewed-by on v1 12/22
#25 lore raw

Re: [PATCH 12/22] csky: fix arch_jump_label_transform_static override

In reply to Arnd Bergmann
Quoted 35 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The arch_jump_label_transform_static() function in csky was originally meant to override the generic __weak function, but that got changed to an #ifndef check.

This showed up as a missing-prototype warning:
arch/csky/kernel/jump_label.c:43:6: error: no previous prototype for 'arch_jump_label_transform_static' [-Werror=missing-prototypes]

Change the method to use the new method of having a #define and a prototype for the global function.

Fixes 7e6b9db27de9 ("jump_label: make initial NOP patching the special case")
Fixes 4e8bb4ba5a55 ("csky: Add jump-label implementation")
---
 arch/csky/include/asm/jump_label.h | 5 +++++
 1 file changed, 5 insertions(+)
arch/csky/include/asm/jump_label.h +5 -1
index d488ba6084bc..98a3f4b168bd 100644
@@ -43,5 +43,10 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key,
        return true;
 }
 
+enum jump_label_type;
+void arch_jump_label_transform_static(struct jump_entry *entry,
+                                     enum jump_label_type type);
+#define arch_jump_label_transform_static arch_jump_label_transform_static
+
 #endif  /* __ASSEMBLY__ */
 #endif /* __ASM_CSKY_JUMP_LABEL_H */
--
Quoted 3 lines

2.39.2

Thank you!

Signature · 2 lines
Best Regards
 Guo Ren
#47 lore raw

Re: [PATCH 17/22] powerpc: ps3: move udbg_shutdown_ps3gelic prototype

In reply to Michael Ellerman

Hi Michael,

Quoted 36 lines · Michael Ellerman
Quoted 27 lines · kernel test robot

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on next-20231108]
[cannot apply to v6.6]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Arnd-Bergmann/ida-make-ida_dump-static/20231109-005742
base:   linus/master
patch link:    https://lore.kernel.org/r/20231108125843.3806765-18-arnd%40kernel.org
patch subject: [PATCH 17/22] powerpc: ps3: move udbg_shutdown_ps3gelic prototype
config: powerpc64-randconfig-001-20231109 (https://download.01.org/0day-ci/archive/20231109/[email protected]/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231109/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

   arch/powerpc/platforms/ps3/gelic_udbg.c:59:1: warning: alignment 1 of 'struct debug_block' is less than 32 [-Wpacked-not-aligned]
      59 | } __packed;
         | ^
Quoted 7 lines
Quoted 1 line
Quoted 1 line

arch/powerpc/platforms/ps3/gelic_udbg.c:240:6: error: redefinition of 'udbg_shutdown_ps3gelic'

240 | void udbg_shutdown_ps3gelic(void)
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from arch/powerpc/platforms/ps3/gelic_udbg.c:17:

   arch/powerpc/include/asm/ps3.h:520:20: note: previous definition of 'udbg_shutdown_ps3gelic' with type 'void(void)'
     520 | static inline void udbg_shutdown_ps3gelic(void) {}
         |                    ^~~~~~~~~~~~~~~~~~~~~~
Quoted 5 lines

As pointed out by Arnd this is due to there being two symbols that control the gelic_udbg.c code.

I don't see the need for PS3GELIC_UDBG, without PPC_EARLY_DEBUG_PS3GELIC it just causes gelic_udbg.c to be built, but never called.

My first thought was: PPC_EARLY_DEBUG_PS3GELIC is meant as an early debugging console, while PS3GELIC_UDBG can be used with xmon later, but that does not seem to be the case.

Quoted 1 line

The diff below fixes the error AFAICS.

So your changes on top LGTM.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
maintainer Acked-by on v1 20/22
#51 lore raw

Re: [PATCH 20/22] usb: fsl-mph-dr-of: mark fsl_usb2_mpc5121_init() static

In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

This function is only called locally and should always have been static:

drivers/usb/host/fsl-mph-dr-of.c:291:5: error: no previous prototype for 'fsl_usb2_mpc5121_init' [-Werror=missing-prototypes]

Fixes 230f7ede6c2f ("USB: add USB EHCI support for MPC5121 SoC")
merge bot Applied
#8 lore raw

[tip: timers/core] time: Make sysfs_get_uname() function visible in header

In reply to Arnd Bergmann
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     a89299c40911ee29c6ec4fb66f9c598cd947265b
Gitweb:        https://git.kernel.org/tip/a89299c40911ee29c6ec4fb66f9c598cd947265b
Author:        Arnd Bergmann <[email protected]>
AuthorDate:    Wed, 08 Nov 2023 13:58:25 +01:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Wed, 22 Nov 2023 14:12:10 +01:00

time: Make sysfs_get_uname() function visible in header

This function is defined globally in clocksource.c and used conditionally in clockevent.c, which the declaration hidden when clockevent support is disabled. This causes a harmless warning in the definition:

kernel/time/clocksource.c:1324:9: warning: no previous prototype for 'sysfs_get_uname' [-Wmissing-prototypes]
1324 | ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt)

Move the declaration out of the #ifdef so it is always visible.

---
 kernel/time/tick-internal.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/time/tick-internal.h +2 -1
index 649f2b4..481b7ab 100644
@@ -56,7 +56,6 @@ extern int clockevents_program_event(struct clock_event_device *dev,
 				     ktime_t expires, bool force);
 extern void clockevents_handle_noop(struct clock_event_device *dev);
 extern int __clockevents_update_freq(struct clock_event_device *dev, u32 freq);
-extern ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt);
 
 /* Broadcasting support */
 # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
@@ -197,3 +196,5 @@ void hrtimers_resume_local(void);
 #else
 #define JIFFIES_SHIFT	8
 #endif
+
+extern ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt);
#38 lore raw

Re: [PATCH 15/22] arch: vdso: consolidate gettime prototypes

In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The VDSO functions are defined as globals in the kernel sources but intended to be called from userspace, so there is no need to declare them in a kernel side header.

This is in -next as commit 42874e4eb35bdfc54f8514685e50434098ba4f6c and breaks an arm64 defconfig build, the 32 bit vDSO build is broken:

/build/stage/linux/arch/arm64/kernel/vdso32/vgettimeofday.c:10:5: error: conflic ting types for ‘__vdso_clock_gettime’; have ‘int(clockid_t, struct old_timespec 32 *)’ {aka ‘int(int, struct old_timespec32 *)’}
10 | int __vdso_clock_gettime(clockid_t clock,

      |     ^~~~~~~~~~~~~~~~~~~~
In file included from /build/stage/linux/arch/arm64/kernel/vdso32/vgettimeofday.
c:8:
/build/stage/linux/include/vdso/gettime.h:16:5: note: previous declaration of ‘__vdso_clock_gettime’ with type ‘int(clockid_t,  struct __kernel_timespec *)’ {aka ‘int(int,  struct __kernel_timespec *)’}
   16 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
      |     ^~~~~~~~~~~~~~~~~~~~
/build/stage/linux/arch/arm64/kernel/vdso32/vgettimeofday.c:28:5: error: conflicting types for ‘__vdso_clock_getres’; have ‘int(clockid_t,  struct old_timespec32 *)’ {aka ‘int(int,  struct old_timespec32 *)’}
   28 | int __vdso_clock_getres(clockid_t clock_id,
      |     ^~~~~~~~~~~~~~~~~~~
/build/stage/linux/include/vdso/gettime.h:15:5: note: previous declaration of ‘__vdso_clock_getres’ with type ‘int(clockid_t,  struct __kernel_timespec *)’ {aka ‘int(int,  struct __kernel_timespec *)’}
   15 | int __vdso_clock_getres(clockid_t clock, struct __kernel_timespec *res);
      |     ^~~~~~~~~~~~~~~~~~~
#55 lore raw

Re: (subset) [PATCH 00/22] -Wmissing-prototype warning fixes

In reply to Arnd Bergmann
Quoted 11 lines · Arnd Bergmann

I slightly dropped the ball on this since last sending the series in August, but a number of warning fixes have made it into the kernel in the meantime, both from my earlier submission and from architecture maintainers.

I have none patches that remain from the previous submission, with two of them reworked according to comments. The additional patches are from more testing across architectures and configurations that I had previously missed.

[...]

Applied to powerpc/next.

[17/22] powerpc: ps3: move udbg_shutdown_ps3gelic prototype

        https://git.kernel.org/powerpc/c/04c40eed3f7ac48ddaf20104489510e743a53c47
[18/22] powerpc: pasemi: mark pas_shutdown() static
        https://git.kernel.org/powerpc/c/0c9a768de64d24e38e27652b8c273725ccc31916
[19/22] powerpc: powermac: mark smp_psurge_{give,take}_timebase static
        https://git.kernel.org/powerpc/c/afb36ac386783d2ef2ed839293c03fd06f470be0

cheers

maintainer Tested-by on v2 8/22
#15 lore raw

Re: [PATCH 08/22] [v2] arch: consolidate arch_irq_work_raise prototypes

In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The prototype was hidden in an #ifdef on x86, which causes a warning:

kernel/irq_work.c:72:13: error: no previous prototype for 'arch_irq_work_raise' [-Werror=missing-prototypes]

This issue is now present upstream.

Quoted 8 lines

Some architectures have a working prototype, while others don't. Fix this by providing it in only one place that is always visible.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#16 lore raw

Re: [PATCH 08/22] [v2] arch: consolidate arch_irq_work_raise prototypes

Quoted 12 lines · Geert Uytterhoeven
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The prototype was hidden in an #ifdef on x86, which causes a warning:

kernel/irq_work.c:72:13: error: no previous prototype for 'arch_irq_work_raise' [-Werror=missing-prototypes]

This issue is now present upstream.

Quoted 3 lines

Some architectures have a working prototype, while others don't. Fix this by providing it in only one place that is always visible.

Quoted 7 lines
Quoted 5 lines

I've sent out the asm-generic pull request now,
that contains the fix. Thanks for the reminder.

Arnd