Skip to content

Commit 04bab35

Browse files
goyalbhumikatiwai
authored andcommitted
ALSA: usb-audio: constify snd_kcontrol_new structures
Declare snd_kcontrol_new structures as const as they are only passed as an argument to the function add_new_ctl. This agrument is of type const, so snd_kcontrol_new structures having this property can be made const too. Signed-off-by: Bhumika Goyal <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent f3b827e commit 04bab35

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sound/usb/mixer_scarlett.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static int scarlett_ctl_meter_get(struct snd_kcontrol *kctl,
477477
return 0;
478478
}
479479

480-
static struct snd_kcontrol_new usb_scarlett_ctl_switch = {
480+
static const struct snd_kcontrol_new usb_scarlett_ctl_switch = {
481481
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
482482
.name = "",
483483
.info = scarlett_ctl_switch_info,
@@ -487,7 +487,7 @@ static struct snd_kcontrol_new usb_scarlett_ctl_switch = {
487487

488488
static const DECLARE_TLV_DB_SCALE(db_scale_scarlett_gain, -12800, 100, 0);
489489

490-
static struct snd_kcontrol_new usb_scarlett_ctl = {
490+
static const struct snd_kcontrol_new usb_scarlett_ctl = {
491491
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
492492
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
493493
SNDRV_CTL_ELEM_ACCESS_TLV_READ,
@@ -499,7 +499,7 @@ static struct snd_kcontrol_new usb_scarlett_ctl = {
499499
.tlv = { .p = db_scale_scarlett_gain }
500500
};
501501

502-
static struct snd_kcontrol_new usb_scarlett_ctl_master = {
502+
static const struct snd_kcontrol_new usb_scarlett_ctl_master = {
503503
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
504504
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
505505
SNDRV_CTL_ELEM_ACCESS_TLV_READ,
@@ -511,23 +511,23 @@ static struct snd_kcontrol_new usb_scarlett_ctl_master = {
511511
.tlv = { .p = db_scale_scarlett_gain }
512512
};
513513

514-
static struct snd_kcontrol_new usb_scarlett_ctl_enum = {
514+
static const struct snd_kcontrol_new usb_scarlett_ctl_enum = {
515515
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
516516
.name = "",
517517
.info = scarlett_ctl_enum_info,
518518
.get = scarlett_ctl_enum_get,
519519
.put = scarlett_ctl_enum_put,
520520
};
521521

522-
static struct snd_kcontrol_new usb_scarlett_ctl_dynamic_enum = {
522+
static const struct snd_kcontrol_new usb_scarlett_ctl_dynamic_enum = {
523523
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
524524
.name = "",
525525
.info = scarlett_ctl_enum_dynamic_info,
526526
.get = scarlett_ctl_enum_get,
527527
.put = scarlett_ctl_enum_put,
528528
};
529529

530-
static struct snd_kcontrol_new usb_scarlett_ctl_sync = {
530+
static const struct snd_kcontrol_new usb_scarlett_ctl_sync = {
531531
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
532532
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
533533
.name = "",

0 commit comments

Comments
 (0)