Skip to contentSkip to conversation

Fix sparse warnings

PATCH In review Ashok Reddy Soma 2 participants 4 messages Feb 21, 2023

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Fix sparse warnings

Run and fix sparse warnings in below files
-arch/arm/mach-zynqmp/include/mach/sys_proto.h -common/spl/spl.c -arch/arm/mach-versal-net/include/mach/sys_proto.h -arch/arm/mach-versal/include/mach/sys_proto.h -drivers/mmc/zynq_sdhci.c -drivers/spi/zynqmp_gqspi.c

Algapally Santosh Sagar (2):
xilinx: zynqmp: Add missing prototype for zynqmp_mmio_write
xilinx: zynqmp: Add missing prototype for board_boot_order

 arch/arm/mach-versal-net/include/mach/sys_proto.h | 7 +------
 arch/arm/mach-versal/include/mach/sys_proto.h     | 6 +-----
 arch/arm/mach-zynqmp/include/mach/sys_proto.h     | 1 +
 common/spl/spl.c                                  | 1 +
 drivers/mmc/zynq_sdhci.c                          | 1 +
 drivers/spi/zynqmp_gqspi.c                        | 5 +++++
 6 files changed, 10 insertions(+), 11 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 xilinx: zynqmp: Add missing prototype for zynqmp_mmio_write

From: Algapally Santosh Sagar <[email protected]>

Add missing prototype to fix the sparse warning, warning: no previous prototype for 'zynqmp_mmio_write' [-Wmissing-prototypes].

---

 arch/arm/mach-versal-net/include/mach/sys_proto.h | 7 +------
 arch/arm/mach-versal/include/mach/sys_proto.h     | 6 +-----
 drivers/mmc/zynq_sdhci.c                          | 1 +
 drivers/spi/zynqmp_gqspi.c                        | 5 +++++
 4 files changed, 8 insertions(+), 11 deletions(-)
arch/arm/mach-versal-net/include/mach/sys_proto.h +1 -6
index 5bba9030f2..a20cf02712 100644
@@ -8,9 +8,4 @@
 
 void mem_map_fill(void);
 
-static inline int zynqmp_mmio_write(const u32 address, const u32 mask,
-				    const u32 value)
-{
-	BUILD_BUG();
-	return -EINVAL;
-}
+int zynqmp_mmio_write(const u32 address, const u32 mask, const u32 value);
arch/arm/mach-versal/include/mach/sys_proto.h +1 -5
index 8e5712e0c9..3f01508ecb 100644
@@ -13,8 +13,4 @@ enum {
 void tcm_init(u8 mode);
 void mem_map_fill(void);
 
-static inline int zynqmp_mmio_write(const u32 address, const u32 mask, const u32 value)
-{
-	BUILD_BUG();
-	return -EINVAL;
-}
+int zynqmp_mmio_write(const u32 address, const u32 mask, const u32 value);
drivers/mmc/zynq_sdhci.c +1 -0
index 8b559d8a7a..9dc310663f 100644
@@ -14,6 +14,7 @@
 #include "mmc_private.h"
 #include <log.h>
 #include <reset.h>
+#include <asm/arch/sys_proto.h>
 #include <dm/device_compat.h>
 #include <linux/err.h>
 #include <linux/libfdt.h>
drivers/spi/zynqmp_gqspi.c +5 -0
index 335b458cb9..c4aee279aa 100644
@@ -183,6 +183,11 @@ struct zynqmp_qspi_priv {
 	const struct spi_mem_op *op;
 };
 
+__weak int zynqmp_mmio_write(const u32 address, const u32 mask, const u32 value)
+{
+	return 0;
+}
+
 static int zynqmp_qspi_of_to_plat(struct udevice *bus)
 {
 	struct zynqmp_qspi_plat *plat = dev_get_plat(bus);
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 xilinx: zynqmp: Add missing prototype for board_boot_order

In reply to Ashok Reddy Soma

From: Algapally Santosh Sagar <[email protected]>

Add missing prototype to fix the sparse warning, warning: no previous prototype for 'board_boot_order' [-Wmissing-prototypes].

---

 arch/arm/mach-zynqmp/include/mach/sys_proto.h | 1 +
 common/spl/spl.c                              | 1 +
 2 files changed, 2 insertions(+)
arch/arm/mach-zynqmp/include/mach/sys_proto.h +1 -0
index c6733ed1bb..0f648c47a3 100644
@@ -51,6 +51,7 @@ unsigned int zynqmp_get_silicon_version(void);
 int zynqmp_mmio_write(const u32 address, const u32 mask, const u32 value);
 int zynqmp_mmio_read(const u32 address, u32 *value);
 
+void board_boot_order(u32 *spl_boot_list);
 void initialize_tcm(bool mode);
 void mem_map_fill(void);
 #if defined(CONFIG_SYS_MEM_RSVD_FOR_MMU) || defined(CONFIG_DEFINE_TCM_OCM_MMAP)
common/spl/spl.c +1 -0
index a630e79866..6e5f326481 100644
@@ -20,6 +20,7 @@
 #include <serial.h>
 #include <spl.h>
 #include <system-constants.h>
+#include <asm/arch/sys_proto.h>
 #include <asm/global_data.h>
 #include <asm-generic/gpio.h>
 #include <asm/u-boot.h>
Signature · 1 line
2.17.1
maintainer
#3 lore raw

Re: [PATCH 2/2] xilinx: zynqmp: Add missing prototype for board_boot_order

Quoted 30 lines · Ashok Reddy Soma

From: Algapally Santosh Sagar <[email protected]>

Add missing prototype to fix the sparse warning, warning: no previous prototype for 'board_boot_order' [-Wmissing-prototypes].

---

  arch/arm/mach-zynqmp/include/mach/sys_proto.h | 1 +
  common/spl/spl.c                              | 1 +
  2 files changed, 2 insertions(+)
arch/arm/mach-zynqmp/include/mach/sys_proto.h +1 -0
index c6733ed1bb..0f648c47a3 100644
@@ -51,6 +51,7 @@ unsigned int zynqmp_get_silicon_version(void);
  int zynqmp_mmio_write(const u32 address, const u32 mask, const u32 value);
  int zynqmp_mmio_read(const u32 address, u32 *value);
 
+void board_boot_order(u32 *spl_boot_list);
  void initialize_tcm(bool mode);
  void mem_map_fill(void);
  #if defined(CONFIG_SYS_MEM_RSVD_FOR_MMU) || defined(CONFIG_DEFINE_TCM_OCM_MMAP)
common/spl/spl.c +0 -0
index a630e79866..6e5f326481 100644

common/spl/spl.c line 23

Quoted 4 lines
common/spl/spl.c +1 -0
@@ -20,6 +20,7 @@
  #include <serial.h>
  #include <spl.h>
  #include <system-constants.h>
+#include <asm/arch/sys_proto.h>

This doesn't look right because then you expect all spl platforms will have this header which is not the case.

It should go to include/spl.h

common/spl/spl.c line 26

Quoted 3 lines
common/spl/spl.c +0 -0
  #include <asm/global_data.h>
  #include <asm-generic/gpio.h>
  #include <asm/u-boot.h>

M