Commit 6c75a92a authored by Coiby Xu's avatar Coiby Xu Committed by Greg Kroah-Hartman

staging: greybus: use __force when assigning __u8 value to snd_ctl_elem_type_t

(struct gb_audio_ctl_elem_info*)->type has the type of __u8 so there is no
concern about the byte order. __force is safe to use.

Found by sparse,

$ make C=2 drivers/staging/greybus/
drivers/staging/greybus/audio_topology.c:185:24: warning: cast to restricted snd_ctl_elem_type_t
Suggested-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarCoiby Xu <coiby.xu@gmail.com>
Link: https://lore.kernel.org/r/20201002233057.74462-3-coiby.xu@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8bb5b59d
...@@ -182,7 +182,7 @@ static int gbcodec_mixer_ctl_info(struct snd_kcontrol *kcontrol, ...@@ -182,7 +182,7 @@ static int gbcodec_mixer_ctl_info(struct snd_kcontrol *kcontrol,
/* update uinfo */ /* update uinfo */
uinfo->access = data->access; uinfo->access = data->access;
uinfo->count = data->vcount; uinfo->count = data->vcount;
uinfo->type = (snd_ctl_elem_type_t)info->type; uinfo->type = (__force snd_ctl_elem_type_t)info->type;
switch (info->type) { switch (info->type) {
case GB_AUDIO_CTL_ELEM_TYPE_BOOLEAN: case GB_AUDIO_CTL_ELEM_TYPE_BOOLEAN:
......
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