Skip to contentSkip to conversation

arm: mach-davinci: mark __maybe_unused struct

PATCH New Brian Norris 2 participants 2 messages Sep 4, 2013 – Sep 12, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mach-davinci: mark __maybe_unused struct

If neither CONFIG_SND_DM365_AIC3X_CODEC nor CONFIG_SND_DM365_VOICE_CODEC are defined, we may get warnings like:

    arch/arm/mach-davinci/board-dm365-evm.c:179:33: warning: 'dm365_evm_snd_data' defined but not used [-Wunused-variable]

To fix this, just mark the struct as __maybe_unused.

Cc Sekhar Nori <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Russell King <[email protected]>
---
 arch/arm/mach-davinci/board-dm365-evm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-davinci/board-dm365-evm.c +1 -1
index 4cdb61c..9be953e 100644
@@ -176,7 +176,7 @@ static struct at24_platform_data eeprom_info = {
 	.context	= (void *)0x7f00,
 };
 
-static struct snd_platform_data dm365_evm_snd_data = {
+static struct snd_platform_data dm365_evm_snd_data __maybe_unused = {
 	.asp_chan_q = EVENTQ_3,
 };
 
Signature · 1 line
1.8.4
#1 lore raw

PATCH 1/1 arm: mach-davinci: mark __maybe_unused struct

Quoted 11 lines · Brian Norris

If neither CONFIG_SND_DM365_AIC3X_CODEC nor CONFIG_SND_DM365_VOICE_CODEC are defined, we may get warnings like:

    arch/arm/mach-davinci/board-dm365-evm.c:179:33: warning: 'dm365_evm_snd_data' defined but not used [-Wunused-variable]

To fix this, just mark the struct as __maybe_unused.

Cc Sekhar Nori <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Russell King <[email protected]>

Thanks, will queue this for -rc cycle. For future, please note that subject line of DaVinci patches need to be prefixed "ARM: davinci: ". Also, the subject should highlight the answer to "Why?" rather than "How?". So, while committing I changed the headline to:

ARM: davinci: dm365 evm: fix unused variable warning

Thanks,
Sekhar