Re: [PATCH 1/5 v2] Add new UUID utility functions

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

 



On 3/11/2011 10:02 AM, Claudio Takahasi wrote:
Hi Johan/Brian,

On Fri, Mar 11, 2011 at 2:30 PM, Elvis Pfützenreuter<epx@xxxxxxxxxxx>  wrote:
From: Claudio Takahasi<claudio.takahasi@xxxxxxxxxxxxx>

New UUID functions will store the UUIDs values on host order. Added
functions to create, compare and convert UUIDs.

[...]

+
+       memcpy(&uuid128->value.u128.data[BASE_UUID16_OFFSET],
+&uuid16->value.u16, sizeof(uuid16->value.u16));

Are you fine with memcpy or it is better to use assignments(as
proposed by Brian)?

Well, the memcpy does have the added advantage of being more immune to memory alignment issues. These structures are all multiple of 4 bytes, so it probably doesn't matter, but the memcpy will place the data in the correct place for all supported architectures, without any danger of misalignment exceptions. I'd now keep it as a memcpy.


Regards,

--
Brian Gix
bgix@xxxxxxxxxxxxxx
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux