Skip to contentSkip to conversation

ALSA: firewire-motu: mark trace helpers as __maybe_unused

PATCH Applied Arnd Bergmann 3 participants 4 messages Apr 19, 2017 – Apr 20, 2017

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

PATCH 1/1 ALSA: firewire-motu: mark trace helpers as __maybe_unused

Two functions were introduced for the purpose of tracing but cause warnings when tracing is disabled:

sound/firewire/motu/amdtp-motu.c:284:13: error: 'copy_message' defined but not used [-Werror=unused-function]
static void copy_message(u64 *frames, __be32 *buffer, unsigned int data_blocks,
sound/firewire/motu/amdtp-motu.c:271:13: error: 'copy_sph' defined but not used [-Werror=unused-function]
static void copy_sph(u32 *frames, __be32 *buffer, unsigned int data_blocks,

Marking them as __maybe_unused will do the right thing here.

Fixes 17909c1b3058 ("ALSA: firewire-motu: add tracepoints for SPH in IEC 61883-1 fashion")
Fixes c6b0b9e65f09 ("ALSA: firewire-motu: add tracepoints for messages for unique protocol")
---
 sound/firewire/motu/amdtp-motu.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
sound/firewire/motu/amdtp-motu.c +6 -4
index 996b5f818918..96f0091144bb 100644
@@ -268,8 +268,9 @@ static void read_midi_messages(struct amdtp_stream *s, __be32 *buffer,
 }
 
 /* For tracepoints. */
-static void copy_sph(u32 *frames, __be32 *buffer, unsigned int data_blocks,
-		     unsigned int data_block_quadlets)
+static void __maybe_unused copy_sph(u32 *frames, __be32 *buffer,
+				    unsigned int data_blocks,
+				    unsigned int data_block_quadlets)
 {
 	unsigned int i;
 
@@ -281,8 +282,9 @@ static void copy_sph(u32 *frames, __be32 *buffer, unsigned int data_blocks,
 }
 
 /* For tracepoints. */
-static void copy_message(u64 *frames, __be32 *buffer, unsigned int data_blocks,
-			 unsigned int data_block_quadlets)
+static void __maybe_unused copy_message(u64 *frames, __be32 *buffer,
+					unsigned int data_blocks,
+					unsigned int data_block_quadlets)
 {
 	unsigned int i;
 
Signature · 1 line
2.9.0
Applied
#1 lore raw
Quoted 9 lines · Arnd Bergmann

Two functions were introduced for the purpose of tracing but cause warnings when tracing is disabled:

sound/firewire/motu/amdtp-motu.c:284:13: error: 'copy_message' defined but not used [-Werror=unused-function]
static void copy_message(u64 *frames, __be32 *buffer, unsigned int data_blocks,
sound/firewire/motu/amdtp-motu.c:271:13: error: 'copy_sph' defined but not used [-Werror=unused-function]
static void copy_sph(u32 *frames, __be32 *buffer, unsigned int data_blocks,

Quoted 5 lines

Marking them as __maybe_unused will do the right thing here.

Fixes 17909c1b3058 ("ALSA: firewire-motu: add tracepoints for SPH in IEC 61883-1 fashion")
Fixes c6b0b9e65f09 ("ALSA: firewire-motu: add tracepoints for messages for unique protocol")

Applied, thanks.

Takashi

maintainer Reviewed-by
#2 lore raw

Hi,

Quoted 11 lines · Takashi Iwai
Quoted 9 lines · Arnd Bergmann

Two functions were introduced for the purpose of tracing but cause warnings when tracing is disabled:

sound/firewire/motu/amdtp-motu.c:284:13: error: 'copy_message' defined but not used [-Werror=unused-function]
static void copy_message(u64 *frames, __be32 *buffer, unsigned int data_blocks,
sound/firewire/motu/amdtp-motu.c:271:13: error: 'copy_sph' defined but not used [-Werror=unused-function]
static void copy_sph(u32 *frames, __be32 *buffer, unsigned int data_blocks,

Quoted 7 lines
Quoted 5 lines

Marking them as __maybe_unused will do the right thing here.

Fixes 17909c1b3058 ("ALSA: firewire-motu: add tracepoints for SPH in IEC 61883-1 fashion")
Fixes c6b0b9e65f09 ("ALSA: firewire-motu: add tracepoints for messages for unique protocol")

Applied, thanks.

I note that Documentation/process/coding-style.rst describes:
'If you have a function or variable which may potentially go unused in a
particular configuration, and the compiler would warn about its definition going unused, mark the definition as __maybe_unused rather than wrapping it in a preprocessor conditional.'

Iwa-san, could I request you to apply below patch in the last week of this development period?
http://mailman.alsa-project.org/pipermail/alsa-devel/2017-April/119806.html

Regards

Takashi Sakamoto
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw
Quoted 31 lines · Takashi Sakamoto

Hi,

Quoted 11 lines · Takashi Iwai
Quoted 9 lines · Arnd Bergmann

Two functions were introduced for the purpose of tracing but cause warnings when tracing is disabled:

sound/firewire/motu/amdtp-motu.c:284:13: error: 'copy_message' defined but not used [-Werror=unused-function]
static void copy_message(u64 *frames, __be32 *buffer, unsigned int data_blocks,
sound/firewire/motu/amdtp-motu.c:271:13: error: 'copy_sph' defined but not used [-Werror=unused-function]
static void copy_sph(u32 *frames, __be32 *buffer, unsigned int data_blocks,

Quoted 7 lines
Quoted 5 lines

Marking them as __maybe_unused will do the right thing here.

Fixes 17909c1b3058 ("ALSA: firewire-motu: add tracepoints for SPH in IEC 61883-1 fashion")
Fixes c6b0b9e65f09 ("ALSA: firewire-motu: add tracepoints for messages for unique protocol")

Applied, thanks.

I note that Documentation/process/coding-style.rst describes:
'If you have a function or variable which may potentially go unused in a particular configuration, and the compiler would warn about its definition going unused, mark the definition as __maybe_unused rather than wrapping it in a preprocessor conditional.'

Quoted 3 lines

Iwa-san, could I request you to apply below patch in the last week of this development period?
http://mailman.alsa-project.org/pipermail/alsa-devel/2017-April/119806.html

Merged now, sorry for overlooking it.

thanks,

Takashi