Skip to contentSkip to conversation

xilinx: versal-net: fix no previous prototype for function warning.

PATCH Applied Prasad Kummari 2 participants 2 messages Sep 5, 2024 – Sep 6, 2024 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xilinx: versal-net: fix no previous prototype for function warning.

Included the SPI header to resolve the no previous prototypes for function. Removed unused mode variable.
sparse warnings
warning: no previous prototype for 'spi_get_env_dev' [-Wmissing-prototypes]
warning: variable 'mode' set but not used [-Wunused-but-set-variable]

---
 board/xilinx/versal-net/board.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
board/xilinx/versal-net/board.c +1 -4
index 1d67e3f318..4d5913cff1 100644
@@ -12,6 +12,7 @@
 #include <env_internal.h>
 #include <log.h>
 #include <malloc.h>
+#include <spi.h>
 #include <time.h>
 #include <asm/cache.h>
 #include <asm/global_data.h>
@@ -196,7 +197,6 @@ static u8 versal_net_get_bootmode(void)
 int spi_get_env_dev(void)
 {
 	struct udevice *dev;
-	const char *mode = NULL;
 	int bootseq = -1;
 
 	switch (versal_net_get_bootmode()) {
@@ -207,7 +207,6 @@ int spi_get_env_dev(void)
 			debug("QSPI driver for QSPI device is not present\n");
 			break;
 		}
-		mode = "xspi";
 		bootseq = dev_seq(dev);
 		break;
 	case QSPI_MODE_32BIT:
@@ -217,7 +216,6 @@ int spi_get_env_dev(void)
 			debug("QSPI driver for QSPI device is not present\n");
 			break;
 		}
-		mode = "xspi";
 		bootseq = dev_seq(dev);
 		break;
 	case OSPI_MODE:
@@ -227,7 +225,6 @@ int spi_get_env_dev(void)
 			debug("OSPI driver for OSPI device is not present\n");
 			break;
 		}
-		mode = "xspi";
 		bootseq = dev_seq(dev);
 		break;
 	default:
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 50 lines · Prasad Kummari

Included the SPI header to resolve the no previous prototypes for function. Removed unused mode variable.
sparse warnings
warning: no previous prototype for 'spi_get_env_dev' [-Wmissing-prototypes]
warning: variable 'mode' set but not used [-Wunused-but-set-variable]

---
  board/xilinx/versal-net/board.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)
board/xilinx/versal-net/board.c +1 -3
index 1d67e3f318..4d5913cff1 100644
@@ -12,6 +12,7 @@
  #include <env_internal.h>
  #include <log.h>
  #include <malloc.h>
+#include <spi.h>
  #include <time.h>
  #include <asm/cache.h>
  #include <asm/global_data.h>
@@ -196,7 +197,6 @@ static u8 versal_net_get_bootmode(void)
  int spi_get_env_dev(void)
  {
  	struct udevice *dev;
-	const char *mode = NULL;
  	int bootseq = -1;
 
  	switch (versal_net_get_bootmode()) {
@@ -207,7 +207,6 @@ int spi_get_env_dev(void)
  			debug("QSPI driver for QSPI device is not present\n");
  			break;
  		}
-		mode = "xspi";
  		bootseq = dev_seq(dev);
  		break;
  	case QSPI_MODE_32BIT:
@@ -217,7 +216,6 @@ int spi_get_env_dev(void)
  			debug("QSPI driver for QSPI device is not present\n");
  			break;
  		}
-		mode = "xspi";
  		bootseq = dev_seq(dev);
  		break;
  	case OSPI_MODE:

board/xilinx/versal-net/board.c int spi_get_env_dev(void) · line 230

Quoted 7 lines
board/xilinx/versal-net/board.c +0 -1
@@ -227,7 +225,6 @@ int spi_get_env_dev(void)
  			debug("OSPI driver for OSPI device is not present\n");
  			break;
  		}
-		mode = "xspi";
  		bootseq = dev_seq(dev);
  		break;
  	default:

Nice.

Applied.
M