Re: [PATCH] ata: sata_dwc_460ex: use platform_get_irq()
From: Damien Le Moal
Date: Tue Jun 30 2026 - 05:29:46 EST
On 6/30/26 18:06, Niklas Cassel wrote:
> On Tue, Jun 30, 2026 at 06:00:46PM +0900, Damien Le Moal wrote:
>> On 6/30/26 17:52, Rosen Penev wrote:
>>>>> Inside ifdef, that is probably why Sashiko did not catch this new warning.
>>>>>
>>>>> Rosen, I suggest that you use dev->of_node directly within the ifdef, and drop the local np variable.
>>>> device_property_present is probably better. But yeah. I'll whip up a v2.
>>> thinking about this some more. Should use IS_ENABLED to prevent hiding
>>> this code from the compiler.
>>
>> What code are you talking about ?
>> What is in the #ifdef CONFIG_SATA_DWC_OLD_DMA ?
>> CONFIG_SATA_DWC_OLD_DMA is determined automatically by Kconfig. So this is not
>> hidding anything and why I did not see the warning in my compile tests
>> (CONFIG_SATA_DWC_OLD_DMA was enabled for me). The report was for Sparc, and
>> CONFIG_SATA_DWC_OLD_DMA was disabled so the unused variable warning showed up.
>
> I think he means: keep the local np variable,
> and replace the #ifdef with
> if (IS_ENABLED(CONFIG_SATA_DWC_OLD_DMA) && !of_property_present(np, "dmas")) {
>
>
> I think it will work for both CONFIG_SATA_DWC_OLD_DMA=y and
> CONFIG_SATA_DWC_OLD_DMA=n without giving any warnings.
I do not think it will. The if() will be compiled out if IS_ENABLED() is false,
but the variable declaration will remain and so will the warning. Unless that
declaration also goes away, IS_ENABLED() will not solve the issue. But if the
variable is removed, I gree is is a lot cleaner !
>
>
>
> Kind regards,
> Niklas
--
Damien Le Moal
Western Digital Research