* [PATCH 1/2] ALSA: cs46xx: mark snd_cs46xx_download_image as static
@ 2023-05-16 19:50 Arnd Bergmann
2023-05-16 19:50 ` [PATCH 2/2] ALSA: oss: avoid missing-prototype warnings Arnd Bergmann
2023-05-17 14:56 ` [PATCH 1/2] ALSA: cs46xx: mark snd_cs46xx_download_image as static Takashi Iwai
0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2023-05-16 19:50 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai; +Cc: Arnd Bergmann, alsa-devel, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
snd_cs46xx_download_image() was originally called from dsp_spos.c, but
is now local to cs46xx_lib.c. Mark it as 'static' to avoid a warning
about it lacking a declaration, and '__maybe_unused' to avoid a warning
about it being unused when CONFIG_SND_CS46XX_NEW_DSP is disabled:
sound/pci/cs46xx/cs46xx_lib.c:534:5: error: no previous prototype for 'snd_cs46xx_download_image'
Fixes: 89f157d9e6bf ("[ALSA] cs46xx - Fix PM resume")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
sound/pci/cs46xx/cs46xx_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 62f45847b351..7d882b33d45e 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -531,7 +531,7 @@ static int load_firmware(struct snd_cs46xx *chip)
return err;
}
-int snd_cs46xx_download_image(struct snd_cs46xx *chip)
+static __maybe_unused int snd_cs46xx_download_image(struct snd_cs46xx *chip)
{
int idx, err;
unsigned int offset = 0;
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ALSA: oss: avoid missing-prototype warnings
2023-05-16 19:50 [PATCH 1/2] ALSA: cs46xx: mark snd_cs46xx_download_image as static Arnd Bergmann
@ 2023-05-16 19:50 ` Arnd Bergmann
2023-05-17 14:56 ` Takashi Iwai
2023-05-17 14:56 ` [PATCH 1/2] ALSA: cs46xx: mark snd_cs46xx_download_image as static Takashi Iwai
1 sibling, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2023-05-16 19:50 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai; +Cc: Arnd Bergmann, alsa-devel, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Two functions are defined and used in pcm_oss.c but also optionally
used from io.c, with an optional prototype. If CONFIG_SND_PCM_OSS_PLUGINS
is disabled, this causes a warning as the functions are not static
and have no prototype:
sound/core/oss/pcm_oss.c:1235:19: error: no previous prototype for 'snd_pcm_oss_write3' [-Werror=missing-prototypes]
sound/core/oss/pcm_oss.c:1266:19: error: no previous prototype for 'snd_pcm_oss_read3' [-Werror=missing-prototypes]
Avoid this by making the prototypes unconditional.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
sound/core/oss/pcm_plugin.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sound/core/oss/pcm_plugin.h b/sound/core/oss/pcm_plugin.h
index 46e273bd4a78..50a6b50f5db4 100644
--- a/sound/core/oss/pcm_plugin.h
+++ b/sound/core/oss/pcm_plugin.h
@@ -141,6 +141,14 @@ int snd_pcm_area_copy(const struct snd_pcm_channel_area *src_channel,
void *snd_pcm_plug_buf_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t size);
void snd_pcm_plug_buf_unlock(struct snd_pcm_substream *plug, void *ptr);
+#else
+
+static inline snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *handle, snd_pcm_uframes_t drv_size) { return drv_size; }
+static inline snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *handle, snd_pcm_uframes_t clt_size) { return clt_size; }
+static inline int snd_pcm_plug_slave_format(int format, const struct snd_mask *format_mask) { return format; }
+
+#endif
+
snd_pcm_sframes_t snd_pcm_oss_write3(struct snd_pcm_substream *substream,
const char *ptr, snd_pcm_uframes_t size,
int in_kernel);
@@ -151,14 +159,6 @@ snd_pcm_sframes_t snd_pcm_oss_writev3(struct snd_pcm_substream *substream,
snd_pcm_sframes_t snd_pcm_oss_readv3(struct snd_pcm_substream *substream,
void **bufs, snd_pcm_uframes_t frames);
-#else
-
-static inline snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *handle, snd_pcm_uframes_t drv_size) { return drv_size; }
-static inline snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *handle, snd_pcm_uframes_t clt_size) { return clt_size; }
-static inline int snd_pcm_plug_slave_format(int format, const struct snd_mask *format_mask) { return format; }
-
-#endif
-
#ifdef PLUGIN_DEBUG
#define pdprintf(fmt, args...) printk(KERN_DEBUG "plugin: " fmt, ##args)
#else
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ALSA: cs46xx: mark snd_cs46xx_download_image as static
2023-05-16 19:50 [PATCH 1/2] ALSA: cs46xx: mark snd_cs46xx_download_image as static Arnd Bergmann
2023-05-16 19:50 ` [PATCH 2/2] ALSA: oss: avoid missing-prototype warnings Arnd Bergmann
@ 2023-05-17 14:56 ` Takashi Iwai
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2023-05-17 14:56 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Jaroslav Kysela, Takashi Iwai, Arnd Bergmann, alsa-devel,
linux-kernel
On Tue, 16 May 2023 21:50:41 +0200,
Arnd Bergmann wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> snd_cs46xx_download_image() was originally called from dsp_spos.c, but
> is now local to cs46xx_lib.c. Mark it as 'static' to avoid a warning
> about it lacking a declaration, and '__maybe_unused' to avoid a warning
> about it being unused when CONFIG_SND_CS46XX_NEW_DSP is disabled:
>
> sound/pci/cs46xx/cs46xx_lib.c:534:5: error: no previous prototype for 'snd_cs46xx_download_image'
>
> Fixes: 89f157d9e6bf ("[ALSA] cs46xx - Fix PM resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks, applied now.
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] ALSA: oss: avoid missing-prototype warnings
2023-05-16 19:50 ` [PATCH 2/2] ALSA: oss: avoid missing-prototype warnings Arnd Bergmann
@ 2023-05-17 14:56 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2023-05-17 14:56 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Jaroslav Kysela, Takashi Iwai, Arnd Bergmann, alsa-devel,
linux-kernel
On Tue, 16 May 2023 21:50:42 +0200,
Arnd Bergmann wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> Two functions are defined and used in pcm_oss.c but also optionally
> used from io.c, with an optional prototype. If CONFIG_SND_PCM_OSS_PLUGINS
> is disabled, this causes a warning as the functions are not static
> and have no prototype:
>
> sound/core/oss/pcm_oss.c:1235:19: error: no previous prototype for 'snd_pcm_oss_write3' [-Werror=missing-prototypes]
> sound/core/oss/pcm_oss.c:1266:19: error: no previous prototype for 'snd_pcm_oss_read3' [-Werror=missing-prototypes]
>
> Avoid this by making the prototypes unconditional.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks, applied now.
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-17 14:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16 19:50 [PATCH 1/2] ALSA: cs46xx: mark snd_cs46xx_download_image as static Arnd Bergmann
2023-05-16 19:50 ` [PATCH 2/2] ALSA: oss: avoid missing-prototype warnings Arnd Bergmann
2023-05-17 14:56 ` Takashi Iwai
2023-05-17 14:56 ` [PATCH 1/2] ALSA: cs46xx: mark snd_cs46xx_download_image as static Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).