Re: [PATCH bluetooth-next 2/3] ieee802154: cleanup ieee802154_be64_to_le64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/10/2015 11:14 PM, Alexander Aring wrote:
> This patch cleanups the ieee802154_be64_to_le64 function. This patch
> removes an unnecessary temporary variable.
> 
> Signed-off-by: Alexander Aring <alex.aring@xxxxxxxxx>
> ---
>  include/net/mac802154.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/include/net/mac802154.h b/include/net/mac802154.h
> index 8506478..a4dcefe 100644
> --- a/include/net/mac802154.h
> +++ b/include/net/mac802154.h
> @@ -233,9 +233,7 @@ struct ieee802154_ops {
>   */
>  static inline void ieee802154_be64_to_le64(void *le64_dst, const void *be64_src)
>  {
> -	__le64 tmp = (__force __le64)swab64p(be64_src);
> -
> -	memcpy(le64_dst, &tmp, IEEE802154_EXTENDED_ADDR_LEN);
> +	*((__le64 *)le64_dst) = (__force __le64)swab64p(be64_src);

I assume the compiler optimizes the memcpy, due to the constant length
argument. It the dst always 64 bit aligned?

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux