Re: [PATCH] ASoC: loongson: mark OF related data as maybe unused
From: Krzysztof Kozlowski
Date: Wed Jul 26 2023 - 04:15:18 EST
On 26/07/2023 09:20, Xi Ruoyao wrote:
> On Wed, 2023-07-26 at 15:06 +0800, YingKun Meng wrote:
>> The ASoC Sound Card driver can be compile tested with !CONFIG_OF
>> making 'loongson_asoc_dt_ids' unused:
>>
>> sound/soc/loongson/loongson_card.c:200:34: warning: unused variable
>> 'loongson_asoc_dt_ids' [-Wunused-const-variable]
>
> Hmm, why not guard the definition with #ifdef CONFIG_OF instead?
>
> Source text is first and foremost for the human reader, not for the
> compiler, and an ifdef clearly shows the condition when the definition
> is not used.
Rather drop of_match_ptr so this can be used also on ACPI.
Best regards,
Krzysztof