[PATCH v3 2/2] csky: Make pfn accessors static inlines
Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as arguments without warnings. For symmetry to the same thing with pfn_to_virt(). In order to do this we move the virt_to_phys() and phys_to_virt() below the definitions of the __pa() and __va() macros so it compiles. The macro version was also able to do recursive symbol resolution. Acked-by: Guo Ren Signed-off-by: Linus Walleij --- arch/csky/include/asm/page.h | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/csky/include/asm/page.h b/arch/csky/include/asm/page.h index b23e3006a9e0..4a0502e324a6 100644 --- a/arch/csky/include/asm/page.h +++ b/arch/csky/include/asm/page.h @@ -34,9 +34,6 @@ #include -#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) -#define pfn_to_virt(pfn)__va((pfn) << PAGE_SHIFT) - #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && \ (void *)(kaddr) < high_memory) @@ -80,6 +77,16 @@ extern unsigned long va_pa_offset; #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) +static inline unsigned long virt_to_pfn(const void *kaddr) +{ + return __pa(kaddr) >> PAGE_SHIFT; +} + +static inline void * pfn_to_virt(unsigned long pfn) +{ + return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT); +} + #define MAP_NR(x) PFN_DOWN((unsigned long)(x) - PAGE_OFFSET - \ PHYS_OFFSET_OFFSET) #define virt_to_page(x)(mem_map + MAP_NR(x)) -- 2.34.1 ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
[PATCH v3 0/2] csky: Convert memory accessors to static inlines
This converts the virt_to_pfn and pfn_to_virt macros into static inlines so we get proper type checking on the pointers passed in. Signed-off-by: Linus Walleij --- Changes in v3: - Do not return const void * from pfn_to_virt(), return void * so we don't case a mess. - Link to v2: https://lore.kernel.org/r/20230809-csky-virt-to-phys-v2-0-2697c93f6...@linaro.org Changes in v2: - Fix compilation error on pfn_to_virt() by more casting. - Return const void * rather than just void * from pfn_to_virt() - Link to v1: https://lore.kernel.org/r/20230808-csky-virt-to-phys-v1-0-ac727f8de...@linaro.org --- Linus Walleij (2): csky: Cast argument to virt_to_pfn() to (void *) csky: Make pfn accessors static inlines arch/arc/include/asm/page.h | 2 +- arch/csky/include/asm/page.h | 13 ++--- 2 files changed, 11 insertions(+), 4 deletions(-) --- base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 change-id: 20230808-csky-virt-to-phys-3d80c17211f9 Best regards, -- Linus Walleij ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
[PATCH v3 1/2] csky: Cast argument to virt_to_pfn() to (void *)
The virt_to_pfn() function takes a (void *) as argument, fix this up to avoid exploiting the unintended polymorphism of virt_to_pfn. Acked-by: Guo Ren Signed-off-by: Linus Walleij --- arch/arc/include/asm/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h index e43fe27ec54d..02b53ad811fb 100644 --- a/arch/arc/include/asm/page.h +++ b/arch/arc/include/asm/page.h @@ -108,7 +108,7 @@ extern int pfn_valid(unsigned long pfn); #else /* CONFIG_HIGHMEM */ -#define ARCH_PFN_OFFSETvirt_to_pfn(CONFIG_LINUX_RAM_BASE) +#define ARCH_PFN_OFFSETvirt_to_pfn((void *)CONFIG_LINUX_RAM_BASE) #endif /* CONFIG_HIGHMEM */ -- 2.34.1 ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
[PATCH 00/17] -Wmissing-prototype warning fixes
From: Arnd Bergmann Most of the patches I sent so far for the -Wmissing-prototype warnings have made it into linux-next now. There are a few that I'm resending now as nobody has picked them up, and then a number of fixes that I found while test-building across all architectures rather than just the ones I usually test. The first 15 patches in this series should be uncontroversial, so I expect that either a subsystem maintainer or Andrew Morton can apply these directly. For the last two patches, these might still need some debate about how to handle them. I added a Kconfig option to turn off most of the missing prototype warnings in the architectures that nobody has fixed yet, see patch 16 for those. The last patch does cause some known warnings and likely unknown ones for architectures other than x86 and arm, so applying it now will bring new problems, but not applying it also means that new warnings creep in, so I think this is mainly a question of what the best timing is for having this in linux-next. Arnd Bergmann (17): [RESEND] jffs2: mark __jffs2_dbg_superblock_counts() static [RESEND] irq_work: consolidate arch_irq_work_raise prototypes [RESEND] ida: make 'ida_dump' static pci: sysfs: move declarations to linux/pci.h swim3: mark swim3_init() static macintosh/ams: mark ams_init() static scsi: qlogicpti: mark qlogicpti_info() static microblaze: mark flush_dcache_folio() inline parport: gsc: mark init function static zorro: include zorro.h in names.c scsi: gvp11: remove unused gvp11_setup() function time: make sysfs_get_uname() function visible in header stackleak: add declarations for global functions kprobes: unify kprobes_exceptions_nofify() prototypes arch: fix asm-offsets.c building with -Wmissing-prototypes [RFC] arch: turn -Wmissing-prototypes off conditionally [RFC] Makefile.extrawarn: turn on missing-prototypes again arch/alpha/Kbuild| 2 ++ arch/alpha/include/asm/pci.h | 3 --- arch/alpha/kernel/asm-offsets.c | 2 +- arch/alpha/lib/Makefile | 1 + arch/arc/Kbuild | 2 ++ arch/arc/include/asm/kprobes.h | 3 --- arch/arm/include/asm/irq_work.h | 2 -- arch/arm/include/asm/kprobes.h | 2 -- arch/arm64/include/asm/irq_work.h| 2 -- arch/arm64/include/asm/kprobes.h | 2 -- arch/csky/Kbuild | 2 ++ arch/csky/include/asm/irq_work.h | 2 +- arch/hexagon/Kbuild | 2 ++ arch/ia64/Kbuild | 2 ++ arch/ia64/include/asm/kprobes.h | 2 -- arch/ia64/kernel/asm-offsets.c | 2 +- arch/ia64/lib/Makefile | 1 + arch/loongarch/Kbuild| 2 ++ arch/loongarch/kernel/asm-offsets.c | 12 arch/m68k/Kbuild | 2 ++ arch/m68k/lib/Makefile | 1 + arch/microblaze/Kbuild | 2 ++ arch/microblaze/include/asm/cacheflush.h | 2 +- arch/mips/Kbuild | 2 ++ arch/mips/boot/compressed/Makefile | 3 ++- arch/mips/include/asm/kprobes.h | 2 -- arch/nios2/Kbuild| 2 ++ arch/nios2/lib/Makefile | 1 + arch/openrisc/Kbuild | 2 ++ arch/parisc/Kbuild | 2 ++ arch/parisc/lib/Makefile | 1 + arch/powerpc/include/asm/irq_work.h | 1 - arch/powerpc/include/asm/kprobes.h | 2 -- arch/riscv/include/asm/irq_work.h| 2 +- arch/s390/include/asm/irq_work.h | 2 -- arch/s390/include/asm/kprobes.h | 2 -- arch/sh/Kbuild | 2 ++ arch/sh/boot/compressed/Makefile | 1 + arch/sh/include/asm/kprobes.h| 2 -- arch/sparc/Kbuild| 2 ++ arch/sparc/include/asm/kprobes.h | 2 -- arch/sparc/kernel/asm-offsets.c | 13 ++--- arch/sparc/lib/Makefile | 1 + arch/sparc/prom/Makefile | 1 + arch/x86/include/asm/irq_work.h | 1 - arch/x86/include/asm/kprobes.h | 2 -- arch/xtensa/Kbuild | 2 ++ arch/xtensa/boot/lib/Makefile| 2 ++ drivers/block/swim3.c| 2 +- drivers/macintosh/ams/ams-core.c | 2 +- drivers/parport/parport_gsc.c| 2 +- drivers/scsi/gvp11.c | 5 - drivers/scsi/qlogicpti.c | 2 +- drivers/zorro/names.c| 1 + fs/jffs2/debug.c | 2 +- include/linux/irq_work.h | 3 +++ include/linux/kprobes.h | 4 include/linux/pci.h | 5 + include/linux/stackleak.h| 6 ++ init/Kconfig | 10 ++ kernel/time/tick-internal.h | 3 ++- lib/test_ida
[PATCH 14/17] kprobes: unify kprobes_exceptions_nofify() prototypes
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 '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. Signed-off-by: Arnd Bergmann --- arch/arc/include/asm/kprobes.h | 3 --- arch/arm/include/asm/kprobes.h | 2 -- arch/arm64/include/asm/kprobes.h | 2 -- arch/ia64/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 11 files changed, 4 insertions(+), 21 deletions(-) diff --git a/arch/arc/include/asm/kprobes.h b/arch/arc/include/asm/kprobes.h index de1566e32cb89..68e8301c0df2c 100644 --- a/arch/arc/include/asm/kprobes.h +++ b/arch/arc/include/asm/kprobes.h @@ -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; diff --git a/arch/arm/include/asm/kprobes.h b/arch/arm/include/asm/kprobes.h index e26a278d301ab..5b8dbf1b0be49 100644 --- a/arch/arm/include/asm/kprobes.h +++ b/arch/arm/include/asm/kprobes.h @@ -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[]; diff --git a/arch/arm64/include/asm/kprobes.h b/arch/arm64/include/asm/kprobes.h index 05cd82eeca136..be7a3680dadff 100644 --- a/arch/arm64/include/asm/kprobes.h +++ b/arch/arm64/include/asm/kprobes.h @@ -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); diff --git a/arch/ia64/include/asm/kprobes.h b/arch/ia64/include/asm/kprobes.h index 9e956768946cc..56004f97df6d2 100644 --- a/arch/ia64/include/asm/kprobes.h +++ b/arch/ia64/include/asm/kprobes.h @@ -107,8 +107,6 @@ struct arch_specific_insn { }; 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 void arch_remove_kprobe(struct kprobe *p); diff --git a/arch/mips/include/asm/kprobes.h b/arch/mips/include/asm/kprobes.h index 68b1e5d458cfb..bc27d99c94363 100644 --- a/arch/mips/include/asm/kprobes.h +++ b/arch/mips/include/asm/kprobes.h @@ -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 */ diff --git a/arch/powerpc/include/asm/kprobes.h b/arch/powerpc/include/asm/kprobes.h index c8e4b4fd4e330..4525a9c68260d 100644 --- a/arch/powerpc/include/asm/kprobes.h +++ b/arch/powerpc/include/asm/kprobes.h @@ -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); diff --git a/arch/s390/include/asm/kprobes.h b/arch/s390/include/asm/kprobes.h index 83f732ca3af4d..3f87125dd9b0d 100644 --- a/arch/s390/include/asm/kprobes.h +++ b/arch/s390/include/asm/kprobes.h @@ -72,8 +72,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) diff --git a/arch/sh/include/asm/kprobes.h b/arch/sh/include/asm/kprobes.h index eeba83e0a7d29..65d4c3316a5bd 100644 --- a/arch/sh/include/asm/kprobes.h +++ b/arch/sh/include/asm/kprobes.h @@ -46,8 +46,6 @@ struct kprobe_c
[PATCH 16/17] [RFC] arch: turn -Wmissing-prototypes off conditionally
From: Arnd Bergmann I have cleaned up the -Wmissing-prototypes warnings for most of the major architectures as well as all drivers that get enabled for CONFIG_COMPILE_TEST, so now these should be close to fixed on x86, arm, arm64, powerpc, s390, and riscv. The other architectures tend to have a lot of these warning in architecture specific code, primarily from functions that are only called from assembler code and do not otherwise need a declaration but still cause a warning without one. Other cases are simply functions that should just be static or are missing an #include statement. In order to be able to turn the warning on globally by default without breaking all these architectures, add a list of exceptions for architecture directories that can revert back to the old behavior of not warning based on a new CONFIG_WNO_MISSING_PROTOTYPES option. Signed-off-by: Arnd Bergmann --- Below is the full list of warnings I see in defconfig builds for reference, these do not need to be part of the changelog. arch/alpha/include/asm/core_t2.h:465:20: error: no previous prototype for 't2_readb' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:476:21: error: no previous prototype for 't2_readw' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:491:21: error: no previous prototype for 't2_readl' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:502:21: error: no previous prototype for 't2_readq' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:515:22: error: no previous prototype for 't2_writeb' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:526:22: error: no previous prototype for 't2_writew' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:541:22: error: no previous prototype for 't2_writel' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:550:22: error: no previous prototype for 't2_writeq' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:562:31: error: no previous prototype for 't2_ioportmap' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:567:31: error: no previous prototype for 't2_ioremap' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:573:21: error: no previous prototype for 't2_is_ioaddr' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:578:21: error: no previous prototype for 't2_is_mmio' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for 't2_ioread16' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for 't2_ioread32' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for 't2_ioread64' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for 't2_ioread8' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for 't2_iowrite16' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for 't2_iowrite32' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for 't2_iowrite64' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for 't2_iowrite8' [-Werror=missing-prototypes] arch/alpha/include/asm/core_t2.h:614:33: error: no previous prototype for 't2_iounmap' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:115:30: error: no previous prototype for 'jensen_local_inb' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:120:22: error: no previous prototype for 'jensen_local_outb' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:126:30: error: no previous prototype for 'jensen_bus_inb' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:135:22: error: no previous prototype for 'jensen_bus_outb' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:155:20: error: no previous prototype for 'jensen_inb' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:163:22: error: no previous prototype for 'jensen_outb' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:171:21: error: no previous prototype for 'jensen_inw' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:181:21: error: no previous prototype for 'jensen_inl' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:187:21: error: no previous prototype for 'jensen_inq' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:193:22: error: no previous prototype for 'jensen_outw' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:200:22: error: no previous prototype for 'jensen_outl' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:207:22: error: no previous prototype for 'jensen_outq' [-Werror=missing-prototypes] arch/alpha/include/asm/jensen.h:218:20: error: no previous prototype for 'jensen_readb' [-We
Re: [PATCH 16/17] [RFC] arch: turn -Wmissing-prototypes off conditionally
Le 10/08/2023 à 16:19, Arnd Bergmann a écrit : > From: Arnd Bergmann > > I have cleaned up the -Wmissing-prototypes warnings for most of the major > architectures > as well as all drivers that get enabled for CONFIG_COMPILE_TEST, so now these > should be > close to fixed on x86, arm, arm64, powerpc, s390, and riscv. > > The other architectures tend to have a lot of these warning in architecture > specific > code, primarily from functions that are only called from assembler code and do > not otherwise need a declaration but still cause a warning without one. Other > cases > are simply functions that should just be static or are missing an #include > statement. > > In order to be able to turn the warning on globally by default without > breaking all > these architectures, add a list of exceptions for architecture directories > that > can revert back to the old behavior of not warning based on a new > CONFIG_WNO_MISSING_PROTOTYPES option. Some architectures only have a few of those errors/warnings. For instance microblaze and parisc only have one each. Isn't it better to fix them rather then turn the errors off ? Others like loongarch which is a recent actively maintained architecture, I'd expect the 30 errors to be easy to fix. Many of the alpha ones seems to be brought by your commit e19d4ebc536d ("alpha: add full ioread64/iowrite64 implementation") Christophe > > Signed-off-by: Arnd Bergmann > --- > Below is the full list of warnings I see in defconfig builds for reference, > these > do not need to be part of the changelog. > > arch/alpha/include/asm/core_t2.h:465:20: error: no previous prototype for > 't2_readb' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:476:21: error: no previous prototype for > 't2_readw' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:491:21: error: no previous prototype for > 't2_readl' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:502:21: error: no previous prototype for > 't2_readq' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:515:22: error: no previous prototype for > 't2_writeb' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:526:22: error: no previous prototype for > 't2_writew' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:541:22: error: no previous prototype for > 't2_writel' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:550:22: error: no previous prototype for > 't2_writeq' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:562:31: error: no previous prototype for > 't2_ioportmap' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:567:31: error: no previous prototype for > 't2_ioremap' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:573:21: error: no previous prototype for > 't2_is_ioaddr' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:578:21: error: no previous prototype for > 't2_is_mmio' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for > 't2_ioread16' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for > 't2_ioread32' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for > 't2_ioread64' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for > 't2_ioread8' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for > 't2_iowrite16' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for > 't2_iowrite32' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for > 't2_iowrite64' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for > 't2_iowrite8' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:614:33: error: no previous prototype for > 't2_iounmap' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:115:30: error: no previous prototype for > 'jensen_local_inb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:120:22: error: no previous prototype for > 'jensen_local_outb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:126:30: error: no previous prototype for > 'jensen_bus_inb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:135:22: error: no previous prototype for > 'jensen_bus_outb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:155:20: error: no previous prototype for > 'jensen_inb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:163:22: error: no previous prototype for > 'jensen_outb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:171:21: error: no previous prototype for > 'jensen_inw' [-Werror=missing-prototypes] > arch/alpha/in
Re: [PATCH 16/17] [RFC] arch: turn -Wmissing-prototypes off conditionally
On Thu, Aug 10, 2023, at 16:59, Christophe Leroy wrote: > Le 10/08/2023 à 16:19, Arnd Bergmann a écrit : >> From: Arnd Bergmann >> >> I have cleaned up the -Wmissing-prototypes warnings for most of the major >> architectures >> as well as all drivers that get enabled for CONFIG_COMPILE_TEST, so now >> these should be >> close to fixed on x86, arm, arm64, powerpc, s390, and riscv. >> >> The other architectures tend to have a lot of these warning in architecture >> specific >> code, primarily from functions that are only called from assembler code and >> do >> not otherwise need a declaration but still cause a warning without one. >> Other cases >> are simply functions that should just be static or are missing an #include >> statement. >> >> In order to be able to turn the warning on globally by default without >> breaking all >> these architectures, add a list of exceptions for architecture directories >> that >> can revert back to the old behavior of not warning based on a new >> CONFIG_WNO_MISSING_PROTOTYPES option. > > Some architectures only have a few of those errors/warnings. > > For instance microblaze and parisc only have one each. Isn't it better > to fix them rather then turn the errors off ? The list was only the 'defconfig' warnings, there are a couple more that I saw with 'allmodconfig', and I'm sure there are even more when dealing with other random configurations. I did send other fixes for microblaze and parisc specific drivers, and I could also send patches for the two defconfig warnings if the maintainers are happy with fixing those but leaving allmodconfig to still warn, but I feel that it's easier for them to just do the last fixes themselves and then remove my hack again. I'll wait for Michal and Helge on these. > Others like loongarch which is a recent actively maintained > architecture, I'd expect the 30 errors to be easy to fix. Agreed, they probably are. > Many of the alpha ones seems to be brought by your commit e19d4ebc536d > ("alpha: add full ioread64/iowrite64 implementation") As far as I can see, those already existing before that patch, though I did touch the same lines there. In the end it's a matter of where to stop, as there are endless configurations to test if I want to do a complete job. I drew the line between powerpc (which I tried to fix) and mips (which I left alone), mainly because the powerpc side was already exhausting and mips has even more obscure configurations. The other ones on the list are all less actively maintained than these two. Arnd ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH 16/17] [RFC] arch: turn -Wmissing-prototypes off conditionally
On 8/10/23 17:21, Arnd Bergmann wrote: On Thu, Aug 10, 2023, at 16:59, Christophe Leroy wrote: Le 10/08/2023 à 16:19, Arnd Bergmann a écrit : From: Arnd Bergmann I have cleaned up the -Wmissing-prototypes warnings for most of the major architectures as well as all drivers that get enabled for CONFIG_COMPILE_TEST, so now these should be close to fixed on x86, arm, arm64, powerpc, s390, and riscv. The other architectures tend to have a lot of these warning in architecture specific code, primarily from functions that are only called from assembler code and do not otherwise need a declaration but still cause a warning without one. Other cases are simply functions that should just be static or are missing an #include statement. In order to be able to turn the warning on globally by default without breaking all these architectures, add a list of exceptions for architecture directories that can revert back to the old behavior of not warning based on a new CONFIG_WNO_MISSING_PROTOTYPES option. Some architectures only have a few of those errors/warnings. For instance microblaze and parisc only have one each. Isn't it better to fix them rather then turn the errors off ? The list was only the 'defconfig' warnings, there are a couple more that I saw with 'allmodconfig', and I'm sure there are even more when dealing with other random configurations. I did send other fixes for microblaze and parisc specific drivers, and I could also send patches for the two defconfig warnings if the maintainers are happy with fixing those but leaving allmodconfig to still warn, but I feel that it's easier for them to just do the last fixes themselves and then remove my hack again. I'll wait for Michal and Helge on these. Arnd, I like your patch! For parisc I've done quite some work during the last few weeks to get such warnings sqeezed out, so please drop the hunk for parisc from your patch. My plan is to become warning-free before 6.5-final. This last one: arch/parisc/lib/ucmpdi2.c:12:5: error: no previous prototype for '__ucmpdi2' [-Werror=missing-prototypes] I'll take care in the parisc for-next tree. Thanks! Helge Others like loongarch which is a recent actively maintained architecture, I'd expect the 30 errors to be easy to fix. Agreed, they probably are. Many of the alpha ones seems to be brought by your commit e19d4ebc536d ("alpha: add full ioread64/iowrite64 implementation") As far as I can see, those already existing before that patch, though I did touch the same lines there. In the end it's a matter of where to stop, as there are endless configurations to test if I want to do a complete job. I drew the line between powerpc (which I tried to fix) and mips (which I left alone), mainly because the powerpc side was already exhausting and mips has even more obscure configurations. The other ones on the list are all less actively maintained than these two. Arnd ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH 16/17] [RFC] arch: turn -Wmissing-prototypes off conditionally
On Thu, Aug 10, 2023, at 17:59, Helge Deller wrote: > On 8/10/23 17:21, Arnd Bergmann wrote: >> On Thu, Aug 10, 2023, at 16:59, Christophe Leroy wrote: >> >> I did send other fixes for microblaze and parisc specific drivers, >> and I could also send patches for the two defconfig warnings if >> the maintainers are happy with fixing those but leaving allmodconfig >> to still warn, but I feel that it's easier for them to just >> do the last fixes themselves and then remove my hack again. >> >> I'll wait for Michal and Helge on these. > > Arnd, I like your patch! > For parisc I've done quite some work during the last few weeks to > get such warnings sqeezed out, so please drop the hunk for parisc from > your patch. My plan is to become warning-free before 6.5-final. > > This last one: > arch/parisc/lib/ucmpdi2.c:12:5: error: no previous prototype for > '__ucmpdi2' [-Werror=missing-prototypes] > I'll take care in the parisc for-next tree. Sounds good to me, thanks! Arnd ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH 16/17] [RFC] arch: turn -Wmissing-prototypes off conditionally
Thx, Arnd, I will clean them up for the csky part. On Thu, Aug 10, 2023 at 10:24 PM Arnd Bergmann wrote: > > From: Arnd Bergmann > > I have cleaned up the -Wmissing-prototypes warnings for most of the major > architectures > as well as all drivers that get enabled for CONFIG_COMPILE_TEST, so now these > should be > close to fixed on x86, arm, arm64, powerpc, s390, and riscv. > > The other architectures tend to have a lot of these warning in architecture > specific > code, primarily from functions that are only called from assembler code and do > not otherwise need a declaration but still cause a warning without one. Other > cases > are simply functions that should just be static or are missing an #include > statement. > > In order to be able to turn the warning on globally by default without > breaking all > these architectures, add a list of exceptions for architecture directories > that > can revert back to the old behavior of not warning based on a new > CONFIG_WNO_MISSING_PROTOTYPES option. > > Signed-off-by: Arnd Bergmann > --- > Below is the full list of warnings I see in defconfig builds for reference, > these > do not need to be part of the changelog. > > arch/alpha/include/asm/core_t2.h:465:20: error: no previous prototype for > 't2_readb' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:476:21: error: no previous prototype for > 't2_readw' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:491:21: error: no previous prototype for > 't2_readl' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:502:21: error: no previous prototype for > 't2_readq' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:515:22: error: no previous prototype for > 't2_writeb' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:526:22: error: no previous prototype for > 't2_writew' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:541:22: error: no previous prototype for > 't2_writel' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:550:22: error: no previous prototype for > 't2_writeq' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:562:31: error: no previous prototype for > 't2_ioportmap' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:567:31: error: no previous prototype for > 't2_ioremap' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:573:21: error: no previous prototype for > 't2_is_ioaddr' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:578:21: error: no previous prototype for > 't2_is_mmio' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for > 't2_ioread16' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for > 't2_ioread32' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for > 't2_ioread64' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:587:23: error: no previous prototype for > 't2_ioread8' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for > 't2_iowrite16' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for > 't2_iowrite32' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for > 't2_iowrite64' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:594:22: error: no previous prototype for > 't2_iowrite8' [-Werror=missing-prototypes] > arch/alpha/include/asm/core_t2.h:614:33: error: no previous prototype for > 't2_iounmap' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:115:30: error: no previous prototype for > 'jensen_local_inb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:120:22: error: no previous prototype for > 'jensen_local_outb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:126:30: error: no previous prototype for > 'jensen_bus_inb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:135:22: error: no previous prototype for > 'jensen_bus_outb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:155:20: error: no previous prototype for > 'jensen_inb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:163:22: error: no previous prototype for > 'jensen_outb' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:171:21: error: no previous prototype for > 'jensen_inw' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:181:21: error: no previous prototype for > 'jensen_inl' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:187:21: error: no previous prototype for > 'jensen_inq' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:193:22: error: no previous prototype for > 'jensen_outw' [-Werror=missing-prototypes] > arch/alpha/include/asm/jensen.h:200:22