From: Brian Gix <bgix@codeaurora.org>
To: Claudio Takahasi <claudio.takahasi@openbossa.org>
Cc: "Johan Hedberg" <johan.hedberg@nokia.com>,
linux-bluetooth@vger.kernel.org,
"Elvis Pfützenreuter" <epx@signove.com>
Subject: Re: [PATCH 1/5 v2] Add new UUID utility functions
Date: Fri, 11 Mar 2011 10:37:48 -0800 [thread overview]
Message-ID: <4D7A6BFC.4040704@codeaurora.org> (raw)
In-Reply-To: <AANLkTims=7dS56VhVQXgSgwkLQsjcu=rYL3cvrsZCfFq@mail.gmail.com>
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@signove.com> wrote:
>> From: Claudio Takahasi<claudio.takahasi@openbossa.org>
>>
>> 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@codeaurora.org
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
prev parent reply other threads:[~2011-03-11 18:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-11 14:30 [PATCH 1/5 v2] Add new UUID utility functions Elvis Pfützenreuter
2011-03-11 14:30 ` [PATCH 2/5 v2] Add more functions for new UUID handling Elvis Pfützenreuter
2011-03-11 14:30 ` [PATCH 3/5 v2] Use new UUID functions in GATT Elvis Pfützenreuter
2011-03-11 14:30 ` [PATCH 4/5 v2] Use new UUID functions in example GATT server Elvis Pfützenreuter
2011-03-11 14:30 ` [PATCH 5/5 v2] Add "unit test" for new UUID functions Elvis Pfützenreuter
2011-03-11 18:02 ` [PATCH 1/5 v2] Add new UUID utility functions Claudio Takahasi
2011-03-11 18:37 ` Brian Gix [this message]
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=4D7A6BFC.4040704@codeaurora.org \
--to=bgix@codeaurora.org \
--cc=claudio.takahasi@openbossa.org \
--cc=epx@signove.com \
--cc=johan.hedberg@nokia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.