Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1626662 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2017-04-19 20:00 +0200 |
| Last post | 2017-04-20 15:10 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] ALSA: firewire-motu: mark trace helpers as __maybe_unused Arnd Bergmann <arnd@arndb.de> - 2017-04-19 20:00 +0200
Re: [PATCH] ALSA: firewire-motu: mark trace helpers as __maybe_unused Takashi Iwai <tiwai@suse.de> - 2017-04-20 13:00 +0200
Re: [PATCH] ALSA: firewire-motu: mark trace helpers as __maybe_unused Takashi Iwai <tiwai@suse.de> - 2017-04-20 15:10 +0200
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2017-04-19 20:00 +0200 |
| Subject | [PATCH] ALSA: firewire-motu: mark trace helpers as __maybe_unused |
| Message-ID | <ty23w-6o6-23@gated-at.bofh.it> |
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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
sound/firewire/motu/amdtp-motu.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sound/firewire/motu/amdtp-motu.c b/sound/firewire/motu/amdtp-motu.c
index 996b5f818918..96f0091144bb 100644
--- a/sound/firewire/motu/amdtp-motu.c
+++ b/sound/firewire/motu/amdtp-motu.c
@@ -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;
--
2.9.0
[toc] | [next] | [standalone]
| From | Takashi Iwai <tiwai@suse.de> |
|---|---|
| Date | 2017-04-20 13:00 +0200 |
| Message-ID | <tyhYC-7U2-17@gated-at.bofh.it> |
| In reply to | #1626662 |
On Wed, 19 Apr 2017 19:51:29 +0200,
Arnd Bergmann wrote:
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thanks.
Takashi
[toc] | [prev] | [next] | [standalone]
| From | Takashi Iwai <tiwai@suse.de> |
|---|---|
| Date | 2017-04-20 15:10 +0200 |
| Message-ID | <tyk0p-Ud-11@gated-at.bofh.it> |
| In reply to | #1627308 |
On Thu, 20 Apr 2017 14:52:13 +0200,
Takashi Sakamoto wrote:
>
> Hi,
>
> On 2017年04月20日 19:51, Takashi Iwai wrote:
> > On Wed, 19 Apr 2017 19:51:29 +0200,
> > Arnd Bergmann wrote:
> >>
> >> 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")
> >> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >
> > Applied, thanks.
>
> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
>
> 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
Merged now, sorry for overlooking it.
thanks,
Takashi
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web