mips: cavium-octeon: fix missing prototypes
PATCH 1/1 mips: cavium-octeon: fix missing prototypes
The compiler throws -Wmissing-prototypes warnings for several functions in the cavium octeon architecture code.
It occurs due to a mix of hardcoded prototypes scattered across C files, a block-scoped extern declaration, and missing header files.
Fix the warnings by:
- Moving the prototype for octeon_fill_mac_addresses() from setup.c to <asm/octeon/octeon.h>
- Removing the block-scoped extern declaration for octeon_send_ipi_single() in mm/c-octeon.c and exposing via <asm/octeon/octeon.h>
- Moving the prototype __cvmx_interrupt_gmxx_rxx_int_en_enable() from cvmx-interrupt-rsl.c to the cvmx-gmxx-defs shared header.
- Adding the missing #include <asm/octeon/cvmx-helper-errata.h> to cvmx-helper-errata.c.
These changes pass the compiler's -Wmissing-prototypes safety checks without changing any runtime logic.
--- arch/mips/cavium-octeon/executive/cvmx-helper-errata.c | 1 + arch/mips/cavium-octeon/executive/cvmx-interrupt-rsl.c | 2 -- arch/mips/cavium-octeon/setup.c | 2 -- arch/mips/include/asm/octeon/cvmx-gmxx-defs.h | 2 ++ arch/mips/include/asm/octeon/octeon.h | 2 ++ arch/mips/mm/c-octeon.c | 1 - 6 files changed, 5 insertions(+), 5 deletions(-)
arch/mips/cavium-octeon/executive/cvmx-helper-errata.c +1 -0
@@ -38,6 +38,7 @@#include <asm/octeon/octeon.h> #include <asm/octeon/cvmx-helper-jtag.h> +#include <asm/octeon/cvmx-helper-errata.h> /** * Due to errata G-720, the 2nd order CDR circuit on CN52XX pass
arch/mips/cavium-octeon/executive/cvmx-interrupt-rsl.c +0 -2
@@ -39,8 +39,6 @@#define PRINT_ERROR (format, ...)#endif -void __cvmx_interrupt_gmxx_rxx_int_en_enable (int index,int block); -/** * Enable ASX error interrupts that exist on CN3XXX, CN50XX, and * CN58XX.
arch/mips/cavium-octeon/setup.c +0 -2
@@ -1156,8 +1156,6 @@ void __init prom_free_prom_memory(void) } } -void __init octeon_fill_mac_addresses (void ); -void __init device_tree_init (void ) {const void *fdt =NULL ;
arch/mips/include/asm/octeon/cvmx-gmxx-defs.h +2 -0
@@ -2256,4 +2256,6 @@ union cvmx_gmxx_tx_xaui_ctl { } s; }; +void __cvmx_interrupt_gmxx_rxx_int_en_enable (int index,int block); +#endif
arch/mips/include/asm/octeon/octeon.h +2 -0
@@ -31,6 +31,7 @@ extern void *octeon_bootmem_alloc_named_address(uint64_t size, uint64_t address,extern int octeon_bootmem_free_named (char *name);extern void octeon_bootmem_lock (void );extern void octeon_bootmem_unlock (void ); +extern void octeon_send_ipi_single (int cpu,unsigned int action);extern int octeon_is_simulation (void );extern int octeon_is_pci_host (void );
@@ -47,6 +48,7 @@ extern void octeon_user_io_init(void);extern void octeon_init_cvmcount (void );extern void octeon_setup_delays (void ); +extern void octeon_fill_mac_addresses (void );extern void octeon_io_clk_delay (unsigned long );#define OCTEON_ARGV_MAX_ARGS 64
arch/mips/mm/c-octeon.c +0 -1
@@ -62,7 +62,6 @@ static void local_octeon_flush_icache_range(unsigned long start,*/ static void octeon_flush_icache_all_cores (struct vm_area_struct *vma) { -extern void octeon_send_ipi_single (int cpu,unsigned int action);#ifdef CONFIG_SMP int cpu;cpumask_t mask;
Signature · 1 line
2.56.0
Thomas Bogendoerfer
maintainerQuoted 22 lines · Timo Joannin
The compiler throws -Wmissing-prototypes warnings for several functions in the cavium octeon architecture code.
It occurs due to a mix of hardcoded prototypes scattered across C files, a block-scoped extern declaration, and missing header files.
Fix the warnings by:
- Moving the prototype forocteon_fill_mac_addresses()fromsetup.cto <asm/octeon/octeon.h>
- Removing the block-scoped extern declaration forocteon_send_ipi_single()inmm/c-octeon.cand exposing via <asm/octeon/octeon.h>
- Moving the prototype__cvmx_interrupt_gmxx_rxx_int_en_enable()fromcvmx-interrupt-rsl.cto the cvmx-gmxx-defs shared header.
- Adding the missing #include <asm/octeon/cvmx-helper-errata.h> tocvmx-helper-errata.c.These changes pass the compiler's -Wmissing-prototypes safety checks without changing any runtime logic.
Signed-off-by Timo Joannin <[email protected]>
Quoted 8 lines
--- arch/mips/cavium-octeon/executive/cvmx-helper-errata.c | 1 + arch/mips/cavium-octeon/executive/cvmx-interrupt-rsl.c | 2 -- arch/mips/cavium-octeon/setup.c | 2 -- arch/mips/include/asm/octeon/cvmx-gmxx-defs.h | 2 ++ arch/mips/include/asm/octeon/octeon.h | 2 ++ arch/mips/mm/c-octeon.c | 1 - 6 files changed, 5 insertions(+), 5 deletions(-)
I've applied https://lore.kernel.org/all/[email protected],
which also cleans up cavium octeon code. So your patch doesn't apply any longer. Can you check, if all your warning fixes are applied, and if not send an updates patch ?
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]
Hi Thomas,
Thanks for letting me know. All the warnings are resolved, no v2 needed.
Thanks,
Timo Joannin