From: Coiby Xu Date: Fri, 2 Oct 2020 23:30:56 +0000 (+0800) Subject: staging: greybus: use __force when assigning __u8 value to snd_ctl_elem_type_t X-Git-Tag: v5.15~2674^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c75a92a0065a009429cec2c69f922f07cbbcd1e;p=platform%2Fkernel%2Flinux-starfive.git 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: Alex Elder Signed-off-by: Coiby Xu Link: https://lore.kernel.org/r/20201002233057.74462-3-coiby.xu@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index 2091031..662e3e8 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -182,7 +182,7 @@ static int gbcodec_mixer_ctl_info(struct snd_kcontrol *kcontrol, /* update uinfo */ uinfo->access = data->access; 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) { case GB_AUDIO_CTL_ELEM_TYPE_BOOLEAN: