From: Coiby Xu <coiby.xu@gmail.com>
To: devel@driverdev.osuosl.org
Cc: Alex Elder <elder@linaro.org>,
Vaibhav Agarwal <vaibhav.sr@gmail.com>,
Mark Greer <mgreer@animalcreek.com>,
Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
greybus-dev@lists.linaro.org (moderated list:GREYBUS SUBSYSTEM),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2 3/3] staging: greybus: use __force when assigning __u8 value to snd_ctl_elem_type_t
Date: Sat, 3 Oct 2020 07:30:56 +0800 [thread overview]
Message-ID: <20201002233057.74462-3-coiby.xu@gmail.com> (raw)
In-Reply-To: <20201002233057.74462-1-coiby.xu@gmail.com>
(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 <elder@linaro.org>
Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
---
drivers/staging/greybus/audio_topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c
index 2091031659de..662e3e8b4b63 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:
--
2.28.0
next prev parent reply other threads:[~2020-10-02 23:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-02 23:30 [PATCH v2 1/3] staging: greybus: fix warnings about endianness detected by sparse Coiby Xu
2020-10-02 23:30 ` [PATCH v2 2/3] staging: greybus: codecs: use SNDRV_PCM_FMTBIT_S16_LE for format bitmask Coiby Xu
2020-10-02 23:30 ` Coiby Xu [this message]
2020-10-05 19:17 ` [PATCH v2 1/3] staging: greybus: fix warnings about endianness detected by sparse Vaibhav Agarwal
2020-10-06 4:14 ` Coiby Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201002233057.74462-3-coiby.xu@gmail.com \
--to=coiby.xu@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=elder@kernel.org \
--cc=elder@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mgreer@animalcreek.com \
--cc=vaibhav.sr@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®