diff mbox series

[2/2] ASoC: Intel: atom: fix 'defined but not used' warning

Message ID 20200701183716.83314-3-pierre-louis.bossart@linux.intel.com (mailing list archive)
State Accepted
Commit 544079abf603bf7823453748285b7cc048b09a9f
Headers show
Series ASoC: Intel: atom: fix kernel-doc and W=1 warnings | expand

Commit Message

Pierre-Louis Bossart July 1, 2020, 6:37 p.m. UTC
Fix W=1 warning. The VOIP controls were not used in the mainline but
in special versions of Android. Keep and use __maybe_used to make
warning go away.

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

Comments

Mark Brown July 1, 2020, 6:44 p.m. UTC | #1
On Wed, Jul 01, 2020 at 01:37:16PM -0500, Pierre-Louis Bossart wrote:
> Fix W=1 warning. The VOIP controls were not used in the mainline but
> in special versions of Android. Keep and use __maybe_used to make
> warning go away.

Why not just remove them?
Pierre-Louis Bossart July 1, 2020, 6:59 p.m. UTC | #2
On 7/1/20 1:44 PM, Mark Brown wrote:
> On Wed, Jul 01, 2020 at 01:37:16PM -0500, Pierre-Louis Bossart wrote:
>> Fix W=1 warning. The VOIP controls were not used in the mainline but
>> in special versions of Android. Keep and use __maybe_used to make
>> warning go away.
> 
> Why not just remove them?

You'll see a lot of patches where tools report variables/tables as not 
used, or not really necessary, it's not clear to me how to deal with 
such cases, so I preferred to err on the side of caution.

I honestly don't know if those products are maintained and by whom. I 
personally have no issue removing this variable, but I've been surprised 
to see 'old' products get a kernel upgrade so when in doubt...
diff mbox series

Patch

diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c
index ca963383ac5e..ff42f629b035 100644
--- a/sound/soc/intel/atom/sst-atom-controls.c
+++ b/sound/soc/intel/atom/sst-atom-controls.c
@@ -723,7 +723,7 @@  SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_pcm2_controls);
 SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_sprot_l0_controls);
 SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_media_l1_controls);
 SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_media_l2_controls);
-SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_voip_controls);
+SST_SBA_DECLARE_MIX_CONTROLS(__maybe_unused sst_mix_voip_controls);
 SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_codec0_controls);
 SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_codec1_controls);
 SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_modem_controls);