From: Marcel Holtmann <marcel@holtmann.org>
To: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: Silence sparse warning
Date: Mon, 19 Mar 2012 10:39:20 -0700 [thread overview]
Message-ID: <1332178760.14217.213.camel@aeonflux> (raw)
In-Reply-To: <1332156398-25953-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
> Silence sparse warning by introducing tmp __le variable. Despite being
> short constructions like "val = le32_to_cpu(val)" are sources of
> unneeded warnings (shown below)
> ...
> net/bluetooth/mgmt.c:448:15: warning: cast to restricted __le32
> ...
>
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
> net/bluetooth/mgmt.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index b8f9016..eb8cb66 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -435,6 +435,7 @@ static u8 bluetooth_base_uuid[] = {
>
> static u16 get_uuid16(u8 *uuid128)
> {
> + __le32 tmp;
> u32 val;
> int i;
>
> @@ -443,9 +444,9 @@ static u16 get_uuid16(u8 *uuid128)
> return 0;
> }
>
> - memcpy(&val, &uuid128[12], 4);
> + memcpy(&tmp, &uuid128[12], 4);
>
> - val = le32_to_cpu(val);
> + val = le32_to_cpu(tmp);
why aren't we using get_unaligned_le32?
Regards
Marcel
next prev parent reply other threads:[~2012-03-19 17:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-19 11:26 [PATCH] Bluetooth: Silence sparse warning Andrei Emeltchenko
2012-03-19 17:39 ` Marcel Holtmann [this message]
2012-03-20 8:34 ` Andrei Emeltchenko
-- strict thread matches above, loose matches on Subject: below --
2012-03-20 8:32 Andrei Emeltchenko
2012-03-20 13:19 ` Gustavo Padovan
2012-03-20 15:49 ` Marcel Holtmann
2012-03-20 16:08 Andrei Emeltchenko
2012-03-20 16:18 ` Marcel Holtmann
2012-03-20 16:24 ` Andrei Emeltchenko
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=1332178760.14217.213.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=Andrei.Emeltchenko.news@gmail.com \
--cc=linux-bluetooth@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