aboutsummaryrefslogtreecommitdiff
path: root/sound/core/control.c
diff options
context:
space:
mode:
authorPaolo Bonzini2022-09-23 10:06:08 -0400
committerPaolo Bonzini2022-09-23 10:06:08 -0400
commit69604fe76e58c9d195e48b41d019b07fc27ce9d7 (patch)
treec9d1e7cfe406a8f168c3aceaf989eea0275d3045 /sound/core/control.c
parent50b2d49bafa16e6311ab2da82f5aafc5f9ada99b (diff)
parent189e7d876e48d7c791fe1c9c01516f70f5621a9f (diff)
Merge tag 'kvm-s390-master-6.0-2' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
More pci fixes Fix for a code analyser warning
Diffstat (limited to 'sound/core/control.c')
-rw-r--r--sound/core/control.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index f3e893715369..a7271927d875 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -385,14 +385,14 @@ static bool elem_id_matches(const struct snd_kcontrol *kctl,
#define MULTIPLIER 37
static unsigned long get_ctl_id_hash(const struct snd_ctl_elem_id *id)
{
+ int i;
unsigned long h;
- const unsigned char *p;
h = id->iface;
h = MULTIPLIER * h + id->device;
h = MULTIPLIER * h + id->subdevice;
- for (p = id->name; *p; p++)
- h = MULTIPLIER * h + *p;
+ for (i = 0; i < SNDRV_CTL_ELEM_ID_NAME_MAXLEN && id->name[i]; i++)
+ h = MULTIPLIER * h + id->name[i];
h = MULTIPLIER * h + id->index;
h &= LONG_MAX;
return h;