[PATCH] spl: ram: fix build warning when neither RAM_DEVICE nor DFU are enabled

Jerome Forissier jerome.forissier at linaro.org
Mon Sep 9 15:22:52 CEST 2024


Fixes the following warning:

common/spl/spl_ram.c:19:14: warning: ‘spl_ram_load_read’ defined but not used [-Wunused-function]
   19 | static ulong spl_ram_load_read(struct spl_load_info *load, ulong sector,
      |              ^~~~~~~~~~~~~~~~~

Signed-off-by: Jerome Forissier <jerome.forissier at linaro.org>
---
 common/spl/spl_ram.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/spl/spl_ram.c b/common/spl/spl_ram.c
index 71b7a8374bb..1a5874c3949 100644
--- a/common/spl/spl_ram.c
+++ b/common/spl/spl_ram.c
@@ -16,6 +16,7 @@
 #include <spl.h>
 #include <linux/libfdt.h>
 
+#if CONFIG_IS_ENABLED(RAM_DEVICE) || CONFIG_IS_ENABLED(DFU)
 static ulong spl_ram_load_read(struct spl_load_info *load, ulong sector,
 			       ulong count, void *buf)
 {
@@ -96,6 +97,8 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
 
 	return ret;
 }
+#endif
+
 #if CONFIG_IS_ENABLED(RAM_DEVICE)
 SPL_LOAD_IMAGE_METHOD("RAM", 0, BOOT_DEVICE_RAM, spl_ram_load_image);
 #endif
-- 
2.40.1



More information about the U-Boot mailing list