Skip to content

Commit 040b5a0

Browse files
arndbtiwai
authored andcommitted
ALSA: oss: avoid missing-prototype warnings
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent ccecefa commit 040b5a0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sound/core/oss/pcm_plugin.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ int snd_pcm_area_copy(const struct snd_pcm_channel_area *src_channel,
141141

142142
void *snd_pcm_plug_buf_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t size);
143143
void snd_pcm_plug_buf_unlock(struct snd_pcm_substream *plug, void *ptr);
144+
#else
145+
146+
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; }
147+
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; }
148+
static inline int snd_pcm_plug_slave_format(int format, const struct snd_mask *format_mask) { return format; }
149+
150+
#endif
151+
144152
snd_pcm_sframes_t snd_pcm_oss_write3(struct snd_pcm_substream *substream,
145153
const char *ptr, snd_pcm_uframes_t size,
146154
int in_kernel);
@@ -151,14 +159,6 @@ snd_pcm_sframes_t snd_pcm_oss_writev3(struct snd_pcm_substream *substream,
151159
snd_pcm_sframes_t snd_pcm_oss_readv3(struct snd_pcm_substream *substream,
152160
void **bufs, snd_pcm_uframes_t frames);
153161

154-
#else
155-
156-
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; }
157-
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; }
158-
static inline int snd_pcm_plug_slave_format(int format, const struct snd_mask *format_mask) { return format; }
159-
160-
#endif
161-
162162
#ifdef PLUGIN_DEBUG
163163
#define pdprintf(fmt, args...) printk(KERN_DEBUG "plugin: " fmt, ##args)
164164
#else

0 commit comments

Comments
 (0)