summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2017-05-17 08:48:18 +0900
committerTakashi Iwai <tiwai@suse.de>2017-05-17 07:25:26 +0200
commitb46fe5d9607c2a14618c746a02892ead0f0f4637 (patch)
treeb1751260711a65bedce5d37495494e49c8bbebfa /sound/core
parente76bf3c4b4e456fa8f2c729fa1e8c644857529a8 (diff)
downloadlinux-b46fe5d9607c2a14618c746a02892ead0f0f4637.tar.bz2
ALSA: pcm: constify function local and read-only table
In a function snd_pcm_hw_params_choose(), target parameters are arranged into a table. Though each entry of this table is read-only, they don't have const qualifier. This commit adds the qualifier. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index af439e5554b6..ab4b1d1e44ee 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1734,7 +1734,7 @@ EXPORT_SYMBOL(snd_pcm_hw_param_last);
int snd_pcm_hw_params_choose(struct snd_pcm_substream *pcm,
struct snd_pcm_hw_params *params)
{
- static int vars[] = {
+ static const int vars[] = {
SNDRV_PCM_HW_PARAM_ACCESS,
SNDRV_PCM_HW_PARAM_FORMAT,
SNDRV_PCM_HW_PARAM_SUBFORMAT,
@@ -1745,7 +1745,8 @@ int snd_pcm_hw_params_choose(struct snd_pcm_substream *pcm,
SNDRV_PCM_HW_PARAM_TICK_TIME,
-1
};
- int err, *v;
+ const int *v;
+ int err;
for (v = vars; *v != -1; v++) {
if (*v != SNDRV_PCM_HW_PARAM_BUFFER_SIZE)