public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
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: Tue, 20 Mar 2012 08:49:36 -0700	[thread overview]
Message-ID: <1332258576.1870.13.camel@aeonflux> (raw)
In-Reply-To: <1332232345-30828-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

> Silence sparse warning 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 |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index b8f9016..d93f2bf 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -443,9 +443,7 @@ static u16 get_uuid16(u8 *uuid128)
>  			return 0;
>  	}
>  
> -	memcpy(&val, &uuid128[12], 4);
> -
> -	val = le32_to_cpu(val);
> +	val = get_unaligned_le32(&uuid128[12]);

I actually prefer get_unaligned_le32(uuid128 + 12) in these cases.

Regards

Marcel



  parent reply	other threads:[~2012-03-20 15:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20  8:32 [PATCH] Bluetooth: Silence sparse warning Andrei Emeltchenko
2012-03-20 13:19 ` Gustavo Padovan
2012-03-20 15:49 ` Marcel Holtmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-20 16:08 Andrei Emeltchenko
2012-03-20 16:18 ` Marcel Holtmann
2012-03-20 16:24   ` Andrei Emeltchenko
2012-03-19 11:26 Andrei Emeltchenko
2012-03-19 17:39 ` Marcel Holtmann
2012-03-20  8:34   ` 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=1332258576.1870.13.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