mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-18 04:54:52 +00:00
ALSA: aloop: Fix PCM format assignment
Fix sparse warnings about PCM format assignment regarding the strong typed snd_pcm_format_t: sound/drivers/aloop.c:352:45: warning: restricted snd_pcm_format_t degrades to integer sound/drivers/aloop.c:355:39: warning: incorrect type in assignment (different base types) sound/drivers/aloop.c:355:39: expected unsigned int format sound/drivers/aloop.c:355:39: got restricted snd_pcm_format_t [usertype] format sound/drivers/aloop.c:1435:34: warning: incorrect type in assignment (different base types) sound/drivers/aloop.c:1435:34: expected long max sound/drivers/aloop.c:1435:34: got restricted snd_pcm_format_t [usertype] sound/drivers/aloop.c:1565:39: warning: incorrect type in assignment (different base types) sound/drivers/aloop.c:1565:39: expected unsigned int format sound/drivers/aloop.c:1565:39: got restricted snd_pcm_format_t [usertype] Some code in this driver assigns an integer value to snd_pcm_format_t via control API, and they need to be with the explicit cast. No functional changes, just sparse warning fixes. Link: https://lore.kernel.org/r/20200206163945.6797-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
f4caf8993e
commit
8c356c524a
1 changed files with 3 additions and 3 deletions
|
@ -118,7 +118,7 @@ struct loopback_cable {
|
||||||
struct loopback_setup {
|
struct loopback_setup {
|
||||||
unsigned int notify: 1;
|
unsigned int notify: 1;
|
||||||
unsigned int rate_shift;
|
unsigned int rate_shift;
|
||||||
unsigned int format;
|
snd_pcm_format_t format;
|
||||||
unsigned int rate;
|
unsigned int rate;
|
||||||
unsigned int channels;
|
unsigned int channels;
|
||||||
struct snd_ctl_elem_id active_id;
|
struct snd_ctl_elem_id active_id;
|
||||||
|
@ -1432,7 +1432,7 @@ static int loopback_format_info(struct snd_kcontrol *kcontrol,
|
||||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
|
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
|
||||||
uinfo->count = 1;
|
uinfo->count = 1;
|
||||||
uinfo->value.integer.min = 0;
|
uinfo->value.integer.min = 0;
|
||||||
uinfo->value.integer.max = SNDRV_PCM_FORMAT_LAST;
|
uinfo->value.integer.max = (__force int)SNDRV_PCM_FORMAT_LAST;
|
||||||
uinfo->value.integer.step = 1;
|
uinfo->value.integer.step = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1443,7 +1443,7 @@ static int loopback_format_get(struct snd_kcontrol *kcontrol,
|
||||||
struct loopback *loopback = snd_kcontrol_chip(kcontrol);
|
struct loopback *loopback = snd_kcontrol_chip(kcontrol);
|
||||||
|
|
||||||
ucontrol->value.integer.value[0] =
|
ucontrol->value.integer.value[0] =
|
||||||
loopback->setup[kcontrol->id.subdevice]
|
(__force int)loopback->setup[kcontrol->id.subdevice]
|
||||||
[kcontrol->id.device].format;
|
[kcontrol->id.device].format;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue