[PATCH] spl: ram: fix build warning when neither RAM_DEVICE nor DFU are enabled
Jerome Forissier
jerome.forissier at linaro.org
Tue Sep 10 10:43:33 CEST 2024
On 9/10/24 04:20, Sean Anderson wrote:
> 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?
I don't think so.
> 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.
Yes, and make SPL_RAM_SUPPORT an internal symbol so that it cannot be enabled
on its own without SPL_DFU or SPL_RAM_DEVICE.
Note that SPL_DFU already selects SPL_RAM_SUPPORT but SPL_RAM_DEVICE "depends on"
it.
If that sounds good to you I will post a new patch.
>
>> 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
>
Thanks,
--
Jerome
More information about the U-Boot
mailing list