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

Sean Anderson seanga2 at gmail.com
Tue Sep 10 04:20:23 CEST 2024


On 9/9/24 09:22, Jerome Forissier wrote:
> 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,
>        |              ^~~~~~~~~~~~~~~~~

Does this config even make sense? What is the point of enabling SPL_RAM_SUPPORT without one of the above configs?

Maybe we should make those configs select RAM_SUPPORT instead.

> 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



More information about the U-Boot mailing list