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

2023-11-08 Thread Christophe Leroy
Le 08/11/2023 à 20:37, Arnd Bergmann a écrit : > On Wed, Nov 8, 2023, at 19:31, Christophe Leroy wrote: >> 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

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

2023-11-08 Thread Zhihao Cheng
在 2023/11/8 20:58, Arnd Bergmann 写道: From: Arnd Bergmann 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

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

2023-11-08 Thread Google
On Wed, 8 Nov 2023 13:58:24 +0100 Arnd Bergmann wrote: > From: Arnd Bergmann > > 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

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

2023-11-08 Thread Geert Uytterhoeven
Hi Arnd, On Wed, Nov 8, 2023 at 10:07 PM Arnd Bergmann wrote: > On Wed, Nov 8, 2023, at 21:42, Geert Uytterhoeven wrote: > > On Wed, Nov 8, 2023 at 2:01 PM Arnd Bergmann wrote: > >> From: Arnd Bergmann > >> > >> Microblaze runs into a single -Wmissing-prototypes warning when that is > >>

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

2023-11-08 Thread Arnd Bergmann
On Wed, Nov 8, 2023, at 21:42, Geert Uytterhoeven wrote: > > On Wed, Nov 8, 2023 at 2:01 PM Arnd Bergmann wrote: >> From: Arnd Bergmann >> >> Microblaze runs into a single -Wmissing-prototypes warning when that is >> enabled: >> >> arch/microblaze/kernel/traps.c:21:6: warning: no previous

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

2023-11-08 Thread Geert Uytterhoeven
Hi Arnd, On Wed, Nov 8, 2023 at 2:01 PM Arnd Bergmann wrote: > From: Arnd Bergmann > > 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

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

2023-11-08 Thread Kent Overstreet
On Wed, Nov 08, 2023 at 01:58:37PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > 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'

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

2023-11-08 Thread Arnd Bergmann
On Wed, Nov 8, 2023, at 19:31, Christophe Leroy wrote: > 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 > >

Re: [PATCH RFC 00/17] Solve iommu probe races around iommu_fwspec

2023-11-08 Thread Jason Gunthorpe
On Wed, Nov 08, 2023 at 06:34:58PM +, André Draszik wrote: > For me, it's working fine so far on master, and I've also done my own back > port > to 6.1 and am currently testing both. An official back port once finalised > could be useful, though :-) Great, I'll post a non-RFC version next

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

2023-11-08 Thread Sam Ravnborg
On Wed, Nov 08, 2023 at 01:58:30PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > 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

Re: [PATCH RFC 00/17] Solve iommu probe races around iommu_fwspec

2023-11-08 Thread André Draszik
Hi Jason, On Fri, 2023-11-03 at 13:44 -0300, Jason Gunthorpe wrote: > This is a more complete solution that the first attempt here: > https://lore.kernel.org/r/1698825902-10685-1-git-send-email-quic_zhenh...@quicinc.com > > I haven't been able to test this on any HW that touches these paths, so

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

2023-11-08 Thread Christophe Leroy
Hi Arnd, Le 08/11/2023 à 13:58, Arnd Bergmann a écrit : > From: Arnd Bergmann > > 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

Re: [PATCH RFC 12/17] iommu: Make iommu_ops_from_fwnode() static

2023-11-08 Thread André Draszik
Hi Jason, On Fri, 2023-11-03 at 13:44 -0300, Jason Gunthorpe wrote: > There are no external callers now. > > Signed-off-by: Jason Gunthorpe > --- >  drivers/iommu/iommu.c | 3 ++- >  include/linux/iommu.h | 6 -- >  2 files changed, 2 insertions(+), 7 deletions(-) > > diff --git

Re: [PATCH RFC 01/17] iommu: Remove struct iommu_ops *iommu from arch_setup_dma_ops()

2023-11-08 Thread Rob Herring
On Fri, Nov 03, 2023 at 01:44:46PM -0300, Jason Gunthorpe wrote: > This is not being used to pass ops, it is just a way to tell if an > iommu driver was probed. These days this can be detected directly via > device_iommu_mapped(). Call device_iommu_mapped() in the two places that > need to check

Re: [PATCH RFC 02/17] of: Do not return struct iommu_ops from of_iommu_configure()

2023-11-08 Thread Rob Herring
On Fri, Nov 03, 2023 at 01:44:47PM -0300, Jason Gunthorpe wrote: > Nothing needs this pointer. Return a normal error code with the usual > IOMMU semantic that ENODEV means 'there is no IOMMU driver'. > > Signed-off-by: Jason Gunthorpe > --- > drivers/iommu/of_iommu.c | 29

Re: [PATCH RFC 03/17] of: Use -ENODEV consistently in of_iommu_configure()

2023-11-08 Thread Rob Herring
On Fri, Nov 03, 2023 at 01:44:48PM -0300, Jason Gunthorpe wrote: > Instead of returning 1 and trying to handle positive error codes just > stick to the convention of returning -ENODEV. Remove references to ops > from of_iommu_configure(), a NULL ops will already generate an error code. nit:

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

2023-11-08 Thread Jakub Kicinski
On Wed, 8 Nov 2023 14:18:09 + Geoff Levand wrote: > Seems good to me. I'll test it next chance I get. > > Signed-off-by: Geoff Levand Seems like this is best routed via powerpc: Acked-by: Jakub Kicinski ___ linux-snps-arc mailing list

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

2023-11-08 Thread Geoff Levand
Hi Arnd, On 11/8/23 12:58, Arnd Bergmann wrote: > From: Arnd Bergmann > > 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

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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:

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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")

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

[PATCH 13/22] arch: add do_page_fault prototypes

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

[PATCH 12/22] csky: fix arch_jump_label_transform_static override

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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. Signed-off-by: Arnd Bergmann ---

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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]

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

[PATCH 07/22] [RESEND] sched: fair: move unused stub functions to header

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

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

2023-11-08 Thread Arnd Bergmann
From: 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:

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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] Acked-by: Helge Deller Acked-by: Sudip Mukherjee Signed-off-by: Arnd Bergmann ---

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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

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

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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]

[PATCH 01/22] [RESEND^2] ida: make 'ida_dump' static

2023-11-08 Thread Arnd Bergmann
From: Arnd Bergmann 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") Signed-off-by: Arnd Bergmann ---

[PATCH 00/22] -Wmissing-prototype warning fixes

2023-11-08 Thread Arnd Bergmann
From: 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

Re: [PATCH RFC 17/17] iommu: Mark dev_iommu_priv_set() with a lockdep

2023-11-08 Thread Baolu Lu
On 2023/11/4 0:45, Jason Gunthorpe wrote: A perfect driver would only call dev_iommu_priv_set() from its probe callback. We've made it functionally correct to call it from the of_xlate by adding a lock around that call. lockdep assert that iommu_probe_device_lock is held to discourage misuse.

Re: [PATCH RFC 01/17] iommu: Remove struct iommu_ops *iommu from arch_setup_dma_ops()

2023-11-08 Thread Baolu Lu
On 2023/11/4 0:44, Jason Gunthorpe wrote: This is not being used to pass ops, it is just a way to tell if an iommu driver was probed. These days this can be detected directly via device_iommu_mapped(). Call device_iommu_mapped() in the two places that need to check it and remove the iommu