[v3,06/10] ASoC: sti: uniperif: fix 'defined by not used' warning
diff mbox series

Message ID 20200707191615.98296-7-pierre-louis.bossart@linux.intel.com
State New
Headers show
Series
  • ASoC: Clean-up W=1 build warnings��� - part2
Related show

Commit Message

Pierre-Louis Bossart July 7, 2020, 7:16 p.m. UTC
Fix W=1 warning. The table uni_tdm_hw is declared in a header included
by multiple C file. This isn't really a good practice but for now
using __maybe_unused makes the following warning go away.

sound/soc/sti/sti_uniperif.c:12:
sound/soc/sti/uniperif.h:1351:38: warning: ‘uni_tdm_hw’ defined but
not used [-Wunused-const-variable=]
 1351 | static const struct snd_pcm_hardware uni_tdm_hw = {
      |                                      ^~~~~~~~~~

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sti/uniperif.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnaud POULIQUEN July 8, 2020, 9:11 a.m. UTC | #1
Hi Pierre-Louis,

On 7/7/20 9:16 PM, Pierre-Louis Bossart wrote:
> Fix W=1 warning. The table uni_tdm_hw is declared in a header included
> by multiple C file. This isn't really a good practice but for now
> using __maybe_unused makes the following warning go away.
> 
> sound/soc/sti/sti_uniperif.c:12:
> sound/soc/sti/uniperif.h:1351:38: warning: ‘uni_tdm_hw’ defined but
> not used [-Wunused-const-variable=]
>  1351 | static const struct snd_pcm_hardware uni_tdm_hw = {
>       |                                      ^~~~~~~~~~
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Thanks for the patch, 
Seems that the same patch has already been proposed by Lee: 
https://www.spinics.net/lists/arm-kernel/msg820327.html

Regards,
Arnaud

> ---
>  sound/soc/sti/uniperif.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sti/uniperif.h b/sound/soc/sti/uniperif.h
> index 2dc2da5d458b..a16adeb7c1e9 100644
> --- a/sound/soc/sti/uniperif.h
> +++ b/sound/soc/sti/uniperif.h
> @@ -1348,7 +1348,7 @@ struct sti_uniperiph_data {
>  	struct sti_uniperiph_dai dai_data;
>  };
>  
> -static const struct snd_pcm_hardware uni_tdm_hw = {
> +static __maybe_unused const struct snd_pcm_hardware uni_tdm_hw = {
>  	.info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
>  		SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP |
>  		SNDRV_PCM_INFO_MMAP_VALID,
>
Pierre-Louis Bossart July 8, 2020, 12:55 p.m. UTC | #2
On 7/8/20 4:11 AM, Arnaud POULIQUEN wrote:
> Hi Pierre-Louis,
> 
> On 7/7/20 9:16 PM, Pierre-Louis Bossart wrote:
>> Fix W=1 warning. The table uni_tdm_hw is declared in a header included
>> by multiple C file. This isn't really a good practice but for now
>> using __maybe_unused makes the following warning go away.
>>
>> sound/soc/sti/sti_uniperif.c:12:
>> sound/soc/sti/uniperif.h:1351:38: warning: ‘uni_tdm_hw’ defined but
>> not used [-Wunused-const-variable=]
>>   1351 | static const struct snd_pcm_hardware uni_tdm_hw = {
>>        |                                      ^~~~~~~~~~
>>
>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> 
> Thanks for the patch,
> Seems that the same patch has already been proposed by Lee:
> https://www.spinics.net/lists/arm-kernel/msg820327.html

that's right, we both fixed the same things, and this is the merged series.
Do you mind providing a tag if you're ok with the change?

> Regards,
> Arnaud
> 
>> ---
>>   sound/soc/sti/uniperif.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/sound/soc/sti/uniperif.h b/sound/soc/sti/uniperif.h
>> index 2dc2da5d458b..a16adeb7c1e9 100644
>> --- a/sound/soc/sti/uniperif.h
>> +++ b/sound/soc/sti/uniperif.h
>> @@ -1348,7 +1348,7 @@ struct sti_uniperiph_data {
>>   	struct sti_uniperiph_dai dai_data;
>>   };
>>   
>> -static const struct snd_pcm_hardware uni_tdm_hw = {
>> +static __maybe_unused const struct snd_pcm_hardware uni_tdm_hw = {
>>   	.info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
>>   		SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP |
>>   		SNDRV_PCM_INFO_MMAP_VALID,
>>
Arnaud POULIQUEN July 8, 2020, 1:33 p.m. UTC | #3
hi

On 7/8/20 2:55 PM, Pierre-Louis Bossart wrote:
> 
> 
> On 7/8/20 4:11 AM, Arnaud POULIQUEN wrote:
>> Hi Pierre-Louis,
>>
>> On 7/7/20 9:16 PM, Pierre-Louis Bossart wrote:
>>> Fix W=1 warning. The table uni_tdm_hw is declared in a header included
>>> by multiple C file. This isn't really a good practice but for now
>>> using __maybe_unused makes the following warning go away.
>>>
>>> sound/soc/sti/sti_uniperif.c:12:
>>> sound/soc/sti/uniperif.h:1351:38: warning: ‘uni_tdm_hw’ defined but
>>> not used [-Wunused-const-variable=]
>>>   1351 | static const struct snd_pcm_hardware uni_tdm_hw = {
>>>        |                                      ^~~~~~~~~~
>>>
>>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>>
>> Thanks for the patch,
>> Seems that the same patch has already been proposed by Lee:
>> https://www.spinics.net/lists/arm-kernel/msg820327.html
> 
> that's right, we both fixed the same things, and this is the merged series.
> Do you mind providing a tag if you're ok with the change?

Sure, just need to known which one i should tag... I saw that you are discussing with Lee 
by default i ack both, i let you decide which one will be merged :)

Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>

> 
>> Regards,
>> Arnaud
>>
>>> ---
>>>   sound/soc/sti/uniperif.h | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/sound/soc/sti/uniperif.h b/sound/soc/sti/uniperif.h
>>> index 2dc2da5d458b..a16adeb7c1e9 100644
>>> --- a/sound/soc/sti/uniperif.h
>>> +++ b/sound/soc/sti/uniperif.h
>>> @@ -1348,7 +1348,7 @@ struct sti_uniperiph_data {
>>>   	struct sti_uniperiph_dai dai_data;
>>>   };
>>>   
>>> -static const struct snd_pcm_hardware uni_tdm_hw = {
>>> +static __maybe_unused const struct snd_pcm_hardware uni_tdm_hw = {
>>>   	.info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
>>>   		SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP |
>>>   		SNDRV_PCM_INFO_MMAP_VALID,
>>>

Patch
diff mbox series

diff --git a/sound/soc/sti/uniperif.h b/sound/soc/sti/uniperif.h
index 2dc2da5d458b..a16adeb7c1e9 100644
--- a/sound/soc/sti/uniperif.h
+++ b/sound/soc/sti/uniperif.h
@@ -1348,7 +1348,7 @@  struct sti_uniperiph_data {
 	struct sti_uniperiph_dai dai_data;
 };
 
-static const struct snd_pcm_hardware uni_tdm_hw = {
+static __maybe_unused const struct snd_pcm_hardware uni_tdm_hw = {
 	.info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP |
 		SNDRV_PCM_INFO_MMAP_VALID,