Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1644577

Re: [PATCH 2/2] ALSA: pcm/oss: mark snd_pcm_plug_slave_format arg as const

From Takashi Sakamoto <o-takashi@sakamocchi.jp>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] ALSA: pcm/oss: mark snd_pcm_plug_slave_format arg as const
Date 2017-05-18 16:10 +0200
Message-ID <tIuhQ-3NF-5@gated-at.bofh.it> (permalink)
References <tItON-3bL-9@gated-at.bofh.it> <tItOP-3bL-61@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On May 18 2017 22:35, Arnd Bergmann wrote:
> Only one of the two declarations has the const modifier in the
> argument list, so we get a warning when CONFIG_SND_PCM_OSS_PLUGINS
> is disabled:
>
> sound/core/oss/pcm_oss.c: In function 'snd_pcm_oss_change_params':
> sound/core/oss/pcm_oss.c:898:47: error: passing argument 2 of 'snd_pcm_plug_slave_format' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
>
> This makes the two declarations match again.
>
> Fixes: e76bf3c4b4e4 ("ALSA: pcm/oss: refer to parameters instead of copying to reduce usage of kernel stack")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  sound/core/oss/pcm_plugin.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Indeed. I overlooked that it's conditional...

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

> diff --git a/sound/core/oss/pcm_plugin.h b/sound/core/oss/pcm_plugin.h
> index 38e2c14cb893..73c068abaca5 100644
> --- a/sound/core/oss/pcm_plugin.h
> +++ b/sound/core/oss/pcm_plugin.h
> @@ -172,7 +172,7 @@ snd_pcm_sframes_t snd_pcm_oss_readv3(struct snd_pcm_substream *substream,
>
>  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, struct snd_mask *format_mask) { return format; }
> +static inline int snd_pcm_plug_slave_format(int format, const struct snd_mask *format_mask) { return format; }
>
>  #endif

Thanks :D

Takashi Sakamoto

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] ALSA: pcm: use "do {} while (0)" for empty macro Arnd Bergmann <arnd@arndb.de> - 2017-05-18 15:40 +0200
  [PATCH 2/2] ALSA: pcm/oss: mark snd_pcm_plug_slave_format arg as const Arnd Bergmann <arnd@arndb.de> - 2017-05-18 15:40 +0200
    Re: [PATCH 2/2] ALSA: pcm/oss: mark snd_pcm_plug_slave_format arg as  const Takashi Sakamoto <o-takashi@sakamocchi.jp> - 2017-05-18 16:10 +0200
  Re: [PATCH 1/2] ALSA: pcm: use "do {} while (0)" for empty macro Takashi Iwai <tiwai@suse.de> - 2017-05-18 16:40 +0200

csiph-web