diff mbox series

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

Message ID 20240909132252.3975017-1-jerome.forissier@linaro.org
State New
Headers show
Series spl: ram: fix build warning when neither RAM_DEVICE nor DFU are enabled | expand

Commit Message

Jerome Forissier Sept. 9, 2024, 1:22 p.m. UTC
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@linaro.org>
---
 common/spl/spl_ram.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Sean Anderson Sept. 10, 2024, 2:20 a.m. UTC | #1
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@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
Jerome Forissier Sept. 10, 2024, 8:43 a.m. UTC | #2
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@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,
diff mbox series

Patch

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