Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: pxa: fix missing-prototypes warnings

The PXA platform has a number of configurations that end up with
a warning like these when building with W=1:

drivers/hwmon/max1111.c:83:5: error: no previous prototype for 'max1111_read_channel' [-Werror=missing-prototypes]
arch/arm/mach-pxa/reset.c:86:6: error: no previous prototype for 'pxa_restart' [-Werror=missing-prototypes]
arch/arm/mach-pxa/mfp-pxa2xx.c:254:5: error: no previous prototype for 'keypad_set_wake' [-Werror=missing-prototypes]
drivers/clk/pxa/clk-pxa25x.c:70:14: error: no previous prototype for 'pxa25x_get_clk_frequency_khz' [-Werror=missing-prototypes]
drivers/clk/pxa/clk-pxa25x.c:325:12: error: no previous prototype for 'pxa25x_clocks_init' [-Werror=missing-prototypes]
drivers/clk/pxa/clk-pxa27x.c:74:14: error: no previous prototype for 'pxa27x_get_clk_frequency_khz' [-Werror=missing-prototypes]
drivers/clk/pxa/clk-pxa27x.c:102:6: error: no previous prototype for 'pxa27x_is_ppll_disabled' [-Werror=missing-prototypes]
drivers/clk/pxa/clk-pxa27x.c:470:12: error: no previous prototype for 'pxa27x_clocks_init' [-Werror=missing-prototypes]
arch/arm/mach-pxa/pxa27x.c:44:6: error: no previous prototype for 'pxa27x_clear_otgph' [-Werror=missing-prototypes]
arch/arm/mach-pxa/pxa27x.c:58:6: error: no previous prototype for 'pxa27x_configure_ac97reset' [-Werror=missing-prototypes]
arch/arm/mach-pxa/spitz_pm.c:170:15: error: no previous prototype for 'spitzpm_read_devdata' [-Werror=missing-prototypes]

The problem is that there is a declaration for each of these, but
it's only seen by the caller and not the callee. Moving these
into appropriate header files ensures that both use the same
calling conventions and it avoids the warnings.

Acked-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20230516153109.514251-11-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+36 -31
-15
arch/arm/mach-pxa/generic.h
··· 27 27 extern void __init pxa26x_init_irq(void); 28 28 29 29 #define pxa27x_handle_irq ichp_handle_irq 30 - extern unsigned pxa27x_get_clk_frequency_khz(int); 31 30 extern void __init pxa27x_init_irq(void); 32 31 extern void __init pxa27x_map_io(void); 33 32 ··· 51 52 static inline void pxa2xx_clear_reset_status(unsigned int mask) {} 52 53 #endif 53 54 54 - /* 55 - * Once fully converted to the clock framework, all these functions should be 56 - * removed, and replaced with a clk_get(NULL, "core"). 57 - */ 58 - #ifdef CONFIG_PXA25x 59 - extern unsigned pxa25x_get_clk_frequency_khz(int); 60 - #else 61 - #define pxa25x_get_clk_frequency_khz(x) (0) 62 - #endif 63 - 64 - #ifdef CONFIG_PXA27x 65 - #else 66 - #define pxa27x_get_clk_frequency_khz(x) (0) 67 - #endif 68 55
+1
arch/arm/mach-pxa/mfp-pxa2xx.c
··· 20 20 21 21 #include "pxa2xx-regs.h" 22 22 #include "mfp-pxa2xx.h" 23 + #include "mfp-pxa27x.h" 23 24 24 25 #include "generic.h" 25 26
+1
arch/arm/mach-pxa/pxa25x.c
··· 27 27 #include <linux/irqchip.h> 28 28 #include <linux/platform_data/mmp_dma.h> 29 29 #include <linux/soc/pxa/cpu.h> 30 + #include <linux/soc/pxa/smemc.h> 30 31 31 32 #include <asm/mach/map.h> 32 33 #include <asm/suspend.h>
+3
arch/arm/mach-pxa/pxa27x.c
··· 24 24 #include <linux/platform_data/i2c-pxa.h> 25 25 #include <linux/platform_data/mmp_dma.h> 26 26 #include <linux/soc/pxa/cpu.h> 27 + #include <linux/soc/pxa/smemc.h> 27 28 28 29 #include <asm/mach/map.h> 29 30 #include <asm/irq.h> ··· 32 31 #include "irqs.h" 33 32 #include "pxa27x.h" 34 33 #include "reset.h" 34 + #include <linux/platform_data/pxa2xx_udc.h> 35 35 #include <linux/platform_data/usb-ohci-pxa27x.h> 36 + #include <linux/platform_data/asoc-pxa.h> 36 37 #include "pm.h" 37 38 #include "addr-map.h" 38 39 #include "smemc.h"
+1
arch/arm/mach-pxa/reset.c
··· 10 10 #include "regs-ost.h" 11 11 #include "reset.h" 12 12 #include "smemc.h" 13 + #include "generic.h" 13 14 14 15 static void do_hw_reset(void); 15 16
+1 -1
arch/arm/mach-pxa/spitz_pm.c
··· 166 166 gpio_get_value(SPITZ_GPIO_SYNC); 167 167 } 168 168 169 - unsigned long spitzpm_read_devdata(int type) 169 + static unsigned long spitzpm_read_devdata(int type) 170 170 { 171 171 switch (type) { 172 172 case SHARPSL_STATUS_ACIN:
+2
drivers/clk/pxa/clk-pxa25x.c
··· 11 11 */ 12 12 #include <linux/clk-provider.h> 13 13 #include <linux/clk.h> 14 + #include <linux/clk/pxa.h> 14 15 #include <linux/clkdev.h> 15 16 #include <linux/io.h> 16 17 #include <linux/of.h> 17 18 #include <linux/soc/pxa/smemc.h> 19 + #include <linux/soc/pxa/cpu.h> 18 20 19 21 #include <dt-bindings/clock/pxa-clock.h> 20 22 #include "clk-pxa.h"
+2 -1
drivers/clk/pxa/clk-pxa27x.c
··· 12 12 #include <linux/clkdev.h> 13 13 #include <linux/of.h> 14 14 #include <linux/soc/pxa/smemc.h> 15 + #include <linux/clk/pxa.h> 15 16 16 17 #include <dt-bindings/clock/pxa-clock.h> 17 18 #include "clk-pxa.h" ··· 100 99 return (unsigned int)clks[0] / KHz; 101 100 } 102 101 103 - bool pxa27x_is_ppll_disabled(void) 102 + static bool pxa27x_is_ppll_disabled(void) 104 103 { 105 104 unsigned long ccsr = readl(clk_regs + CCSR); 106 105
+1
drivers/hwmon/max1111.c
··· 80 80 #ifdef CONFIG_SHARPSL_PM 81 81 static struct max1111_data *the_max1111; 82 82 83 + int max1111_read_channel(int channel); 83 84 int max1111_read_channel(int channel) 84 85 { 85 86 if (!the_max1111 || !the_max1111->spi)
-6
drivers/usb/gadget/udc/pxa27x_udc.c
··· 2472 2472 udc_disable(udc); 2473 2473 } 2474 2474 2475 - #ifdef CONFIG_PXA27x 2476 - extern void pxa27x_clear_otgph(void); 2477 - #else 2478 - #define pxa27x_clear_otgph() do {} while (0) 2479 - #endif 2480 - 2481 2475 #ifdef CONFIG_PM 2482 2476 /** 2483 2477 * pxa_udc_suspend - Suspend udc device
+1 -6
drivers/usb/host/ohci-pxa27x.c
··· 29 29 #include <linux/of_platform.h> 30 30 #include <linux/of_gpio.h> 31 31 #include <linux/platform_data/usb-ohci-pxa27x.h> 32 + #include <linux/platform_data/pxa2xx_udc.h> 32 33 #include <linux/platform_device.h> 33 34 #include <linux/regulator/consumer.h> 34 35 #include <linux/signal.h> ··· 263 262 udelay(11); 264 263 __raw_writel(uhchr & ~UHCHR_FHR, pxa_ohci->mmio_base + UHCHR); 265 264 } 266 - 267 - #ifdef CONFIG_PXA27x 268 - extern void pxa27x_clear_otgph(void); 269 - #else 270 - #define pxa27x_clear_otgph() do {} while (0) 271 - #endif 272 265 273 266 static int pxa27x_start_hc(struct pxa27x_ohci *pxa_ohci, struct device *dev) 274 267 {
+1
include/linux/platform_data/asoc-pxa.h
··· 27 27 } pxa2xx_audio_ops_t; 28 28 29 29 extern void pxa_set_ac97_info(pxa2xx_audio_ops_t *ops); 30 + extern void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio); 30 31 31 32 #endif
+6
include/linux/platform_data/pxa2xx_udc.h
··· 25 25 int gpio_pullup; /* high == pullup activated */ 26 26 }; 27 27 28 + #ifdef CONFIG_PXA27x 29 + extern void pxa27x_clear_otgph(void); 30 + #else 31 + #define pxa27x_clear_otgph() do {} while (0) 32 + #endif 33 + 28 34 #endif
+16
include/linux/soc/pxa/smemc.h
··· 10 10 unsigned int pxa3xx_smemc_get_memclkdiv(void); 11 11 void __iomem *pxa_smemc_get_mdrefr(void); 12 12 13 + /* 14 + * Once fully converted to the clock framework, all these functions should be 15 + * removed, and replaced with a clk_get(NULL, "core"). 16 + */ 17 + #ifdef CONFIG_PXA25x 18 + extern unsigned pxa25x_get_clk_frequency_khz(int); 19 + #else 20 + #define pxa25x_get_clk_frequency_khz(x) (0) 21 + #endif 22 + 23 + #ifdef CONFIG_PXA27x 24 + extern unsigned pxa27x_get_clk_frequency_khz(int); 25 + #else 26 + #define pxa27x_get_clk_frequency_khz(x) (0) 27 + #endif 28 + 13 29 #endif
-2
sound/arm/pxa2xx-ac97-lib.c
··· 33 33 static int reset_gpio; 34 34 static void __iomem *ac97_reg_base; 35 35 36 - extern void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio); 37 - 38 36 /* 39 37 * Beware PXA27x bugs: 40 38 *