From: Linus Walleij <linus.walleij@linaro.org>
To: Hennie Muller <hm@bitlabs.co.za>, Arnd Bergmann <arnd@arndb.de>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] [PATCH] gpio: Explicitly cast from __be16 to unsigned short
Date: Mon, 5 Aug 2019 11:10:56 +0200 [thread overview]
Message-ID: <CACRpkdZ0OYt4q3a=kEWswKZ0z779aDFNg8wbm9Tqa+ddgiW3dA@mail.gmail.com> (raw)
In-Reply-To: <20190721125259.13990-2-hm@bitlabs.co.za>
On Sun, Jul 21, 2019 at 2:53 PM Hennie Muller <hm@bitlabs.co.za> wrote:
> cpu_to_be16 returns a __be16 value. This does not break anything
> but does cause sparse to generate unnecessary warnings.
>
> Signed-off-by: Hennie Muller <hm@bitlabs.co.za>
(...)
> - gbmsg->val = cpu_to_be16(dir << offset);
> - gbmsg->mask = cpu_to_be16(0x0001 << offset);
> + gbmsg->val = (__force u16)cpu_to_be16(dir << offset);
> + gbmsg->mask = (__force u16)cpu_to_be16(0x0001 << offset);
Ugh I don't understand this.
Arnd: you know this better than me: is this the right thing to do
to get rid of sparse warnings from the code?
Yours,
Linus Walleij
next prev parent reply other threads:[~2019-08-05 9:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-21 12:52 [PATCH 1/2] [PATCH] gpio: Replace usage of bare 'unsigned' with 'unsigned int' Hennie Muller
2019-07-21 12:52 ` [PATCH 2/2] [PATCH] gpio: Explicitly cast from __be16 to unsigned short Hennie Muller
2019-08-05 9:10 ` Linus Walleij [this message]
2019-08-05 11:52 ` Arnd Bergmann
2019-07-22 2:05 ` [PATCH 1/2] [PATCH] gpio: Replace usage of bare 'unsigned' with 'unsigned int' Phil Reid
2019-07-22 4:51 ` Hennie Muller
2019-08-05 9:26 ` Linus Walleij
2019-08-05 9:27 ` Linus Walleij
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='CACRpkdZ0OYt4q3a=kEWswKZ0z779aDFNg8wbm9Tqa+ddgiW3dA@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=arnd@arndb.de \
--cc=bgolaszewski@baylibre.com \
--cc=hm@bitlabs.co.za \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).