Skip to contentSkip to conversation

More -Wmissing-prototypes fixes

PATCH New Sascha Hauer 1 participant 13 messages Nov 19, 2018

Subsystems (10)
lore
Share & tools
lore
#1 lore raw

PATCH 1/12 ARM: start: Add missing prototype

In reply to Sascha Hauer
---
 arch/arm/cpu/start.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/cpu/start.c +2 -0
index 0b3722e31d..768fa9e1b2 100644
@@ -233,6 +233,8 @@ __noreturn void barebox_non_pbl_start(unsigned long membase,
 
 #ifndef CONFIG_PBL_IMAGE
 
+void start(void);
+
 void NAKED __section(.text_entry) start(void)
 {
 	barebox_arm_head();
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#9 lore raw

PATCH 9/12 usb: musb: Add missing includes

In reply to Sascha Hauer

phy-am335x.c and phy-am335x-control.c both implement functions that they do not include the header file providing the prototype for. Add the missing include and remove the duplicate definition of struct phy_control.

---
 drivers/usb/musb/phy-am335x-control.c | 5 +----
 drivers/usb/musb/phy-am335x.c         | 1 +
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/usb/musb/phy-am335x-control.c +1 -4
index 55a2ed27b7..c84525ec7e 100644
@@ -4,10 +4,7 @@
 #include <linux/err.h>
 #include <linux/spinlock.h>
 
-struct phy_control {
-	void (*phy_power)(struct phy_control *phy_ctrl, u32 id, bool on);
-	void (*phy_wkup)(struct phy_control *phy_ctrl, u32 id, bool on);
-};
+#include "am35x-phy-control.h"
 
 struct am335x_control_usb {
 	struct device_d *dev;
drivers/usb/musb/phy-am335x.c +1 -0
index ec8c0f538b..df31255d89 100644
@@ -5,6 +5,7 @@
 #include <linux/err.h>
 #include "am35x-phy-control.h"
 #include "musb_core.h"
+#include "phy-am335x.h"
 
 struct am335x_usbphy {
 	void __iomem *base;
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#0 lore raw

cover More -Wmissing-prototypes fixes

It's a long way to go still...

Sascha Hauer (12):
ARM: start: Add missing prototype
ARM: samsung: remove unused function
ARM: samsung: make locally used function static
ARM: samsung: provide prototype for nand_boot()
ARM: samsung: Add missing include
state: remove unused function
mtd: nand: omap: Add header file for bch decoder
net: cpsw: Make locally used function static
usb: musb: Add missing includes
spi: omap: make locally used functions static
bus: omap-gpmc: make locally used function static
ARM: omap: Add missing includes

 arch/arm/boards/a9m2440/a9m2410dev.c              |  2 ++
 arch/arm/cpu/start.c                              |  2 ++
 arch/arm/mach-omap/am33xx_bbu_emmc.c              |  1 +
 arch/arm/mach-omap/am33xx_bbu_nand.c              |  1 +
 arch/arm/mach-omap/am33xx_bbu_spi_mlo.c           |  1 +
 arch/arm/mach-omap/am33xx_clock.c                 |  1 +
 arch/arm/mach-samsung/clocks-s3c24xx.c            | 11 +----------
 arch/arm/mach-samsung/include/mach/s3c24xx-nand.h |  2 ++
 common/state/state_variables.c                    | 13 -------------
 drivers/bus/omap-gpmc.c                           |  2 +-
 drivers/mtd/nand/nand_omap_bch_decoder.c          |  2 ++
 drivers/mtd/nand/nand_omap_bch_decoder.h          |  6 ++++++
 drivers/mtd/nand/nand_omap_gpmc.c                 |  4 ++--
 drivers/net/cpsw.c                                |  2 +-
 drivers/spi/omap3_spi.c                           |  8 ++++----
 drivers/usb/musb/phy-am335x-control.c             |  5 +----
 drivers/usb/musb/phy-am335x.c                     |  1 +
 17 files changed, 29 insertions(+), 35 deletions(-)
 create mode 100644 drivers/mtd/nand/nand_omap_bch_decoder.h
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

PATCH 5/12 ARM: samsung: Add missing include

---
 arch/arm/boards/a9m2440/a9m2410dev.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boards/a9m2440/a9m2410dev.c +2 -0
index f12a0b9652..b115c4a954 100644
@@ -28,6 +28,8 @@
 #include <mach/s3c-busctl.h>
 #include <mach/s3c24xx-gpio.h>
 
+#include "baseboards.h"
+
 /**
  * Initialize the CPU to be able to work with the a9m2410dev evaluation board
  */
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

PATCH 7/12 mtd: nand: omap: Add header file for bch decoder

In reply to Sascha Hauer

omap_gpmc_decode_bch() is defined in its user rather than properly in a header file. Add a header file to be included by both its user and the file implementing it.

---
 drivers/mtd/nand/nand_omap_bch_decoder.c | 2 ++
 drivers/mtd/nand/nand_omap_bch_decoder.h | 6 ++++++
 drivers/mtd/nand/nand_omap_gpmc.c        | 4 ++--
 3 files changed, 10 insertions(+), 2 deletions(-)
 create mode 100644 drivers/mtd/nand/nand_omap_bch_decoder.h
drivers/mtd/nand/nand_omap_bch_decoder.c +2 -0
index 64e8031785..4dd28a7704 100644
@@ -15,6 +15,8 @@
 
 #include <common.h>
 
+#include "nand_omap_bch_decoder.h"
+
 #define mm		13
 #define kk_shorten	4096
 #define nn		8191	/* Length of codeword, n = 2**mm - 1 */
drivers/mtd/nand/nand_omap_bch_decoder.h new file +6 -0
new file mode 100644
index 0000000000..74d24be028
@@ -0,0 +1,6 @@
+#ifndef MTD_OMAP_GPMC_DECODE_BCH_H
+#define MTD_OMAP_GPMC_DECODE_BCH_H
+
+int omap_gpmc_decode_bch(int select_4_8, unsigned char *ecc, unsigned int *err_loc);
+
+#endif /* MTD_OMAP_GPMC_DECODE_BCH_H */
\ No newline at end of file
drivers/mtd/nand/nand_omap_gpmc.c +2 -2
index d0b1699839..323a9c7532 100644
@@ -71,6 +71,8 @@
 #include <mach/gpmc.h>
 #include <mach/gpmc_nand.h>
 
+#include "nand_omap_bch_decoder.h"
+
 #define GPMC_ECC_CONFIG_ECCENABLE		(1 << 0)
 #define GPMC_ECC_CONFIG_ECCCS(x)		(((x) & 0x7) << 1)
 #define GPMC_ECC_CONFIG_ECCTOPSECTOR(x)		(((x) & 0x7) << 4)
@@ -90,8 +92,6 @@
 static const uint8_t bch8_vector[] = {0xf3, 0xdb, 0x14, 0x16, 0x8b, 0xd2,
 		0xbe, 0xcc, 0xac, 0x6b, 0xff, 0x99, 0x7b};
 
-int omap_gpmc_decode_bch(int select_4_8, unsigned char *ecc, unsigned int *err_loc);
-
 static const char *ecc_mode_strings[] = {
 	"software",
 	"hamming_hw_romcode",
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/12 ARM: samsung: make locally used function static

In reply to Sascha Hauer
---
 arch/arm/mach-samsung/clocks-s3c24xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-samsung/clocks-s3c24xx.c +1 -1
index a958352556..34b38f345c 100644
@@ -128,7 +128,7 @@ unsigned s3c_get_uart_clk(unsigned src)
 /**
  * Show the user the current clock settings
  */
-int s3c24xx_dump_clocks(void)
+static int s3c24xx_dump_clocks(void)
 {
 	printf("refclk:  %7d kHz\n", S3C24XX_CLOCK_REFERENCE / 1000);
 	printf("mpll:    %7d kHz\n", s3c_get_mpllclk() / 1000);
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 4/12 ARM: samsung: provide prototype for nand_boot()

In reply to Sascha Hauer
---
 arch/arm/mach-samsung/include/mach/s3c24xx-nand.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-samsung/include/mach/s3c24xx-nand.h +2 -0
index f9c6d91b5b..52642ee81f 100644
@@ -52,4 +52,6 @@ struct s3c24x0_nand_platform_data {
  * @brief Basic declaration to use the s3c24x0 NAND driver
  */
 
+void nand_boot(void);
+
 #endif /* MACH_S3C24XX_NAND_H */
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

PATCH 6/12 state: remove unused function

In reply to Sascha Hauer

state_find_type() is unused and doesn't have a prototype. Remove it.

---
 common/state/state_variables.c | 13 -------------
 1 file changed, 13 deletions(-)
common/state/state_variables.c +0 -13
index abd714ceda..269d175874 100644
@@ -492,19 +492,6 @@ struct variable_type *state_find_type_by_name(const char *name)
 	return NULL;
 }
 
-struct variable_type *state_find_type(const enum state_variable_type type)
-{
-	int i;
-
-	for (i = 0; i < ARRAY_SIZE(types); i++) {
-		if (type == types[i].type) {
-			return &types[i];
-		}
-	}
-
-	return NULL;
-}
-
 struct state_variable *state_find_var(struct state *state, const char *name)
 {
 	struct state_variable *sv;
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#11 lore raw

PATCH 11/12 bus: omap-gpmc: make locally used function static

In reply to Sascha Hauer
---
 drivers/bus/omap-gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/omap-gpmc.c +1 -1
index be9ef92851..a3fccb2182 100644
@@ -187,7 +187,7 @@ static unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
 	return (time_ns * 1000 + tick_ps - 1) / tick_ps;
 }
 
-int gpmc_calc_divider(unsigned int sync_clk)
+static int gpmc_calc_divider(unsigned int sync_clk)
 {
 	int div;
 	u32 l;
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/12 ARM: samsung: remove unused function

In reply to Sascha Hauer

s3c24_get_uclk() is unused, remove it.

---
 arch/arm/mach-samsung/clocks-s3c24xx.c | 9 ---------
 1 file changed, 9 deletions(-)
arch/arm/mach-samsung/clocks-s3c24xx.c +0 -9
index 13e68678e1..a958352556 100644
@@ -108,15 +108,6 @@ uint32_t s3c_get_pclk(void)
 	return p_clk;
 }
 
-/**
- * Calculate the UCLK frequency used by the USB host device
- * @return Current frequency in Hz
- */
-uint32_t s3c24_get_uclk(void)
-{
-	return s3c_get_upllclk();
-}
-
 /**
  * Return correct UART frequency based on the UCON register
  */
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

PATCH 8/12 net: cpsw: Make locally used function static

In reply to Sascha Hauer
---
 drivers/net/cpsw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/cpsw.c +1 -1
index c6fc21dc54..c32fc5e442 100644
@@ -1115,7 +1115,7 @@ static int cpsw_probe_dt(struct cpsw_priv *priv)
 	return 0;
 }
 
-int cpsw_probe(struct device_d *dev)
+static int cpsw_probe(struct device_d *dev)
 {
 	struct resource *iores;
 	struct cpsw_platform_data *data = (struct cpsw_platform_data *)dev->platform_data;
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#12 lore raw

PATCH 12/12 ARM: omap: Add missing includes

In reply to Sascha Hauer

Include header files that provide the prototypes for functions implemented in that C files.

---
 arch/arm/mach-omap/am33xx_bbu_emmc.c    | 1 +
 arch/arm/mach-omap/am33xx_bbu_nand.c    | 1 +
 arch/arm/mach-omap/am33xx_bbu_spi_mlo.c | 1 +
 arch/arm/mach-omap/am33xx_clock.c       | 1 +
 4 files changed, 4 insertions(+)
arch/arm/mach-omap/am33xx_bbu_emmc.c +1 -0
index 1fd7222ddc..29e13de778 100644
@@ -18,6 +18,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <filetype.h>
+#include <mach/bbu.h>
 
 #define PART_TABLE_SIZE		66
 #define PART_TABLE_OFFSET	0x1BE
arch/arm/mach-omap/am33xx_bbu_nand.c +1 -0
index 6fc6e7e40f..4c1a28d37e 100644
@@ -22,6 +22,7 @@
 #include <fcntl.h>
 #include <libfile.h>
 #include <filetype.h>
+#include <mach/bbu.h>
 
 struct nand_bbu_handler {
 	struct bbu_handler bbu_handler;
arch/arm/mach-omap/am33xx_bbu_spi_mlo.c +1 -0
index 03477dbaf1..7d2ef1f0f2 100644
@@ -20,6 +20,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <linux/stat.h>
+#include <mach/bbu.h>
 
 /*
  * AM35xx, AM33xx chips use big endian MLO for SPI NOR flash
arch/arm/mach-omap/am33xx_clock.c +1 -0
index ad735cb216..e63e93601e 100644
@@ -15,6 +15,7 @@
 #include <common.h>
 #include <asm/io.h>
 #include <mach/am33xx-clock.h>
+#include <mach/am33xx-generic.h>
 #include <asm-generic/div64.h>
 
 #define PRCM_MOD_EN		0x2
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#10 lore raw

PATCH 10/12 spi: omap: make locally used functions static

In reply to Sascha Hauer
---
 drivers/spi/omap3_spi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/spi/omap3_spi.c +4 -4
index f63039718f..beea772aa9 100644
@@ -67,7 +67,7 @@ static void spi_reset(struct spi_master *master)
 	writel(OMAP3_MCSPI_WAKEUPENABLE_WKEN, regs + OMAP3_MCSPI_WAKEUPENABLE);
 }
 
-int spi_claim_bus(struct spi_device *spi)
+static int spi_claim_bus(struct spi_device *spi)
 {
 	struct spi_master *master = spi->master;
 	struct omap3_spi_master *omap3_master = container_of(master, struct omap3_spi_master, master);
@@ -144,7 +144,7 @@ int spi_claim_bus(struct spi_device *spi)
 	return 0;
 }
 
-int omap3_spi_write(struct spi_device *spi, unsigned int len, const u8 *txp,
+static int omap3_spi_write(struct spi_device *spi, unsigned int len, const u8 *txp,
 		    unsigned long flags)
 {
 	struct spi_master *master = spi->master;
@@ -198,7 +198,7 @@ int omap3_spi_write(struct spi_device *spi, unsigned int len, const u8 *txp,
 	return 0;
 }
 
-int omap3_spi_read(struct spi_device *spi, unsigned int len, u8 *rxp,
+static int omap3_spi_read(struct spi_device *spi, unsigned int len, u8 *rxp,
 		   unsigned long flags)
 {
 	struct spi_master *master = spi->master;
@@ -245,7 +245,7 @@ int omap3_spi_read(struct spi_device *spi, unsigned int len, u8 *rxp,
 	return 0;
 }
 
-int spi_xfer(struct spi_device *spi, struct spi_transfer *t, unsigned long flags)
+static int spi_xfer(struct spi_device *spi, struct spi_transfer *t, unsigned long flags)
 {
 	struct spi_master *master = spi->master;
 	struct omap3_spi_master *omap3_master = container_of(master, struct omap3_spi_master, master);
Signature · 7 lines
2.19.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox