diff mbox series

ALSA: control: remove useless assignment in .info callback of PCM chmap element

Message ID 20191214131351.28950-1-o-takashi@sakamocchi.jp (mailing list archive)
State New, archived
Headers show
Series ALSA: control: remove useless assignment in .info callback of PCM chmap element | expand

Commit Message

Takashi Sakamoto Dec. 14, 2019, 1:13 p.m. UTC
Control elements for PCM chmap return information to userspace abount
the maximum number of available PCM channels as the number of values
in the element.

In current implementation the number is once initialized to zero, then
assigned to. This is useless and this commit fixes it.

Fixes: 2d3391ec0ecc ("ALSA: PCM: channel mapping API implementation")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/core/pcm_lib.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Takashi Iwai Dec. 14, 2019, 3:39 p.m. UTC | #1
On Sat, 14 Dec 2019 14:13:51 +0100,
Takashi Sakamoto wrote:
> 
> Control elements for PCM chmap return information to userspace abount
> the maximum number of available PCM channels as the number of values
> in the element.
> 
> In current implementation the number is once initialized to zero, then
> assigned to. This is useless and this commit fixes it.
> 
> Fixes: 2d3391ec0ecc ("ALSA: PCM: channel mapping API implementation")
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

Thanks, applied.


Takashi
diff mbox series

Patch

diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 2236b5e0c1f2..6f0a00fd3ae5 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -2308,7 +2308,6 @@  static int pcm_chmap_ctl_info(struct snd_kcontrol *kcontrol,
 	struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
 
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-	uinfo->count = 0;
 	uinfo->count = info->max_channels;
 	uinfo->value.integer.min = 0;
 	uinfo->value.integer.max = SNDRV_CHMAP_LAST;