Commit 454f5ec1 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: mixer: oss: Constify snd_mixer_oss_assign_table definition

The snd_mixer_oss_assign_table is read-only, and can it be declared as
const.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-32-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f8ae2d29
...@@ -486,7 +486,7 @@ struct slot { ...@@ -486,7 +486,7 @@ struct slot {
unsigned int channels; unsigned int channels;
unsigned int numid[SNDRV_MIXER_OSS_ITEM_COUNT]; unsigned int numid[SNDRV_MIXER_OSS_ITEM_COUNT];
unsigned int capture_item; unsigned int capture_item;
struct snd_mixer_oss_assign_table *assigned; const struct snd_mixer_oss_assign_table *assigned;
unsigned int allocated: 1; unsigned int allocated: 1;
}; };
...@@ -934,8 +934,8 @@ static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn) ...@@ -934,8 +934,8 @@ static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn)
struct slot *p = chn->private_data; struct slot *p = chn->private_data;
if (p) { if (p) {
if (p->allocated && p->assigned) { if (p->allocated && p->assigned) {
kfree(p->assigned->name); kfree_const(p->assigned->name);
kfree(p->assigned); kfree_const(p->assigned);
} }
kfree(p); kfree(p);
} }
...@@ -953,7 +953,7 @@ static void mixer_slot_clear(struct snd_mixer_oss_slot *rslot) ...@@ -953,7 +953,7 @@ static void mixer_slot_clear(struct snd_mixer_oss_slot *rslot)
/* In a separate function to keep gcc 3.2 happy - do NOT merge this in /* In a separate function to keep gcc 3.2 happy - do NOT merge this in
snd_mixer_oss_build_input! */ snd_mixer_oss_build_input! */
static int snd_mixer_oss_build_test_all(struct snd_mixer_oss *mixer, static int snd_mixer_oss_build_test_all(struct snd_mixer_oss *mixer,
struct snd_mixer_oss_assign_table *ptr, const struct snd_mixer_oss_assign_table *ptr,
struct slot *slot) struct slot *slot)
{ {
char str[64]; char str[64];
...@@ -1017,7 +1017,9 @@ static int snd_mixer_oss_build_test_all(struct snd_mixer_oss *mixer, ...@@ -1017,7 +1017,9 @@ static int snd_mixer_oss_build_test_all(struct snd_mixer_oss *mixer,
* ptr_allocated means the entry is dynamically allocated (change via proc file). * ptr_allocated means the entry is dynamically allocated (change via proc file).
* when replace_old = 1, the old entry is replaced with the new one. * when replace_old = 1, the old entry is replaced with the new one.
*/ */
static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mixer_oss_assign_table *ptr, int ptr_allocated, int replace_old) static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer,
const struct snd_mixer_oss_assign_table *ptr,
int ptr_allocated, int replace_old)
{ {
struct slot slot; struct slot slot;
struct slot *pslot; struct slot *pslot;
...@@ -1255,7 +1257,7 @@ static void snd_mixer_oss_proc_done(struct snd_mixer_oss *mixer) ...@@ -1255,7 +1257,7 @@ static void snd_mixer_oss_proc_done(struct snd_mixer_oss *mixer)
static void snd_mixer_oss_build(struct snd_mixer_oss *mixer) static void snd_mixer_oss_build(struct snd_mixer_oss *mixer)
{ {
static struct snd_mixer_oss_assign_table table[] = { static const struct snd_mixer_oss_assign_table table[] = {
{ SOUND_MIXER_VOLUME, "Master", 0 }, { SOUND_MIXER_VOLUME, "Master", 0 },
{ SOUND_MIXER_VOLUME, "Front", 0 }, /* fallback */ { SOUND_MIXER_VOLUME, "Front", 0 }, /* fallback */
{ SOUND_MIXER_BASS, "Tone Control - Bass", 0 }, { SOUND_MIXER_BASS, "Tone Control - Bass", 0 },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment