summaryrefslogtreecommitdiffstats
path: root/sound/core/oss
diff options
context:
space:
mode:
authorTakashi Sakamoto2017-05-17 01:48:20 +0200
committerTakashi Iwai2017-05-17 07:24:39 +0200
commitb55f9fdcd3f0b3da7c9d4b6c67d75a1878653221 (patch)
tree207f922b47ed7bbd0086f2bd42c1a9deec88585c /sound/core/oss
parentALSA: pcm: add const qualifier for read-only table for sampling rate (diff)
downloadkernel-qcow2-linux-b55f9fdcd3f0b3da7c9d4b6c67d75a1878653221.tar.gz
kernel-qcow2-linux-b55f9fdcd3f0b3da7c9d4b6c67d75a1878653221.tar.xz
kernel-qcow2-linux-b55f9fdcd3f0b3da7c9d4b6c67d75a1878653221.zip
ALSA: pcm: use helper function to refer parameter as read-only
ALSA pcm core has hw_param_interval_c() to pick up parameter with const qualifier for safe programming. This commit applies it to the cases. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/oss')
-rw-r--r--sound/core/oss/pcm_oss.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 36baf962f9b0..2a473513bd54 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -799,7 +799,7 @@ static int snd_pcm_oss_period_size(struct snd_pcm_substream *substream,
static int choose_rate(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, unsigned int best_rate)
{
- struct snd_interval *it;
+ const struct snd_interval *it;
struct snd_pcm_hw_params *save;
unsigned int rate, prev;
@@ -807,7 +807,7 @@ static int choose_rate(struct snd_pcm_substream *substream,
if (save == NULL)
return -ENOMEM;
*save = *params;
- it = hw_param_interval(save, SNDRV_PCM_HW_PARAM_RATE);
+ it = hw_param_interval_c(save, SNDRV_PCM_HW_PARAM_RATE);
/* try multiples of the best rate */
rate = best_rate;