Skip to content

Commit a9ae9c5

Browse files
committed
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>
1 parent f8ef123 commit a9ae9c5

15 files changed

Lines changed: 36 additions & 31 deletions

File tree

arch/arm/mach-pxa/generic.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ extern void __init pxa25x_map_io(void);
2727
extern void __init pxa26x_init_irq(void);
2828

2929
#define pxa27x_handle_irq ichp_handle_irq
30-
extern unsigned pxa27x_get_clk_frequency_khz(int);
3130
extern void __init pxa27x_init_irq(void);
3231
extern void __init pxa27x_map_io(void);
3332

@@ -52,18 +51,4 @@ extern void pxa2xx_clear_reset_status(unsigned int);
5251
static inline void pxa2xx_clear_reset_status(unsigned int mask) {}
5352
#endif
5453

55-
/*
56-
* Once fully converted to the clock framework, all these functions should be
57-
* removed, and replaced with a clk_get(NULL, "core").
58-
*/
59-
#ifdef CONFIG_PXA25x
60-
extern unsigned pxa25x_get_clk_frequency_khz(int);
61-
#else
62-
#define pxa25x_get_clk_frequency_khz(x) (0)
63-
#endif
64-
65-
#ifdef CONFIG_PXA27x
66-
#else
67-
#define pxa27x_get_clk_frequency_khz(x) (0)
68-
#endif
6954

arch/arm/mach-pxa/mfp-pxa2xx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "pxa2xx-regs.h"
2222
#include "mfp-pxa2xx.h"
23+
#include "mfp-pxa27x.h"
2324

2425
#include "generic.h"
2526

arch/arm/mach-pxa/pxa25x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/irqchip.h>
2828
#include <linux/platform_data/mmp_dma.h>
2929
#include <linux/soc/pxa/cpu.h>
30+
#include <linux/soc/pxa/smemc.h>
3031

3132
#include <asm/mach/map.h>
3233
#include <asm/suspend.h>

arch/arm/mach-pxa/pxa27x.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,17 @@
2424
#include <linux/platform_data/i2c-pxa.h>
2525
#include <linux/platform_data/mmp_dma.h>
2626
#include <linux/soc/pxa/cpu.h>
27+
#include <linux/soc/pxa/smemc.h>
2728

2829
#include <asm/mach/map.h>
2930
#include <asm/irq.h>
3031
#include <asm/suspend.h>
3132
#include "irqs.h"
3233
#include "pxa27x.h"
3334
#include "reset.h"
35+
#include <linux/platform_data/pxa2xx_udc.h>
3436
#include <linux/platform_data/usb-ohci-pxa27x.h>
37+
#include <linux/platform_data/asoc-pxa.h>
3538
#include "pm.h"
3639
#include "addr-map.h"
3740
#include "smemc.h"

arch/arm/mach-pxa/reset.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "regs-ost.h"
1111
#include "reset.h"
1212
#include "smemc.h"
13+
#include "generic.h"
1314

1415
static void do_hw_reset(void);
1516

arch/arm/mach-pxa/spitz_pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static bool spitz_charger_wakeup(void)
166166
gpio_get_value(SPITZ_GPIO_SYNC);
167167
}
168168

169-
unsigned long spitzpm_read_devdata(int type)
169+
static unsigned long spitzpm_read_devdata(int type)
170170
{
171171
switch (type) {
172172
case SHARPSL_STATUS_ACIN:

drivers/clk/pxa/clk-pxa25x.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
*/
1212
#include <linux/clk-provider.h>
1313
#include <linux/clk.h>
14+
#include <linux/clk/pxa.h>
1415
#include <linux/clkdev.h>
1516
#include <linux/io.h>
1617
#include <linux/of.h>
1718
#include <linux/soc/pxa/smemc.h>
19+
#include <linux/soc/pxa/cpu.h>
1820

1921
#include <dt-bindings/clock/pxa-clock.h>
2022
#include "clk-pxa.h"

drivers/clk/pxa/clk-pxa27x.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/clkdev.h>
1313
#include <linux/of.h>
1414
#include <linux/soc/pxa/smemc.h>
15+
#include <linux/clk/pxa.h>
1516

1617
#include <dt-bindings/clock/pxa-clock.h>
1718
#include "clk-pxa.h"
@@ -99,7 +100,7 @@ unsigned int pxa27x_get_clk_frequency_khz(int info)
99100
return (unsigned int)clks[0] / KHz;
100101
}
101102

102-
bool pxa27x_is_ppll_disabled(void)
103+
static bool pxa27x_is_ppll_disabled(void)
103104
{
104105
unsigned long ccsr = readl(clk_regs + CCSR);
105106

drivers/hwmon/max1111.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ static int max1111_read(struct device *dev, int channel)
8080
#ifdef CONFIG_SHARPSL_PM
8181
static struct max1111_data *the_max1111;
8282

83+
int max1111_read_channel(int channel);
8384
int max1111_read_channel(int channel)
8485
{
8586
if (!the_max1111 || !the_max1111->spi)

drivers/usb/gadget/udc/pxa27x_udc.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,12 +2472,6 @@ static void pxa_udc_shutdown(struct platform_device *_dev)
24722472
udc_disable(udc);
24732473
}
24742474

2475-
#ifdef CONFIG_PXA27x
2476-
extern void pxa27x_clear_otgph(void);
2477-
#else
2478-
#define pxa27x_clear_otgph() do {} while (0)
2479-
#endif
2480-
24812475
#ifdef CONFIG_PM
24822476
/**
24832477
* pxa_udc_suspend - Suspend udc device

0 commit comments

Comments
 (0)