Re: [PATCH 03/17] spi: cadence_qspi: Use APB write protection

"Kumar, Udit" <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <[email protected]>

On 8/2/2026 4:27 AM, Ralph Siemsen wrote:
> On Sat, Aug 1, 2026 at 11:33 AM Kumar, Udit <[email protected]> wrote:
>>
>> Could you share your compiler details
>>
>> My compiler reports warning (gcc version 11.3.1 20220712)
>>
>> ../drivers/spi/cadence_qspi_apb.c:334:13: warning:
>> ‘cadence_qspi_apb_write_protect_enable’ defined but not used
>> [-Wunused-function]
>>   334 | static void cadence_qspi_apb_write_protect_enable(void *reg_base)
> 
> I'm using arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1 20231009.
> 
> I would also expect a warning, but none appears. Even when I change
> the "caller" to
> 
>     if (0)
>         cadence_qspi_apb_write_protect_disable(priv->regbase);
> 
> there is no warning. However if I remove those two "caller" lines
> completely, then I get the warning:
> 
>     drivers/spi/cadence_qspi_apb.c:334:13: warning:
> 'cadence_qspi_apb_write_protect_disable' defined but not used
> [-Wunused-function]
> 
> I'm compiling with CONFIG_CC_OPTIMIZE_FOR_SIZE and #
> CONFIG_OPTIMIZE_INLINING is not set (eg. the default values).
> 
> Either way, I am happy to add back an #ifdef around the function definitions.
> 

#ifdef will leads to checkpatch warning.
I suggest using __maybe_unused option for these two functions.


> Regards,
> Ralph
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.