Re: [PATCH BlueZ v1 01/15] gatt: Add function to create constant attributes

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

 



Hi Johan,

On Thu, Mar 13, 2014 at 5:30 AM, Johan Hedberg <johan.hedberg@xxxxxxxxx> wrote:
> Hi Claudio,
>
> On Wed, Mar 12, 2014, Claudio Takahasi wrote:
>> +static inline void put_uuid(const bt_uuid_t *src, void *dst)
>> +{
>> +     if (src->type == BT_UUID16)
>> +             put_unaligned(cpu_to_le16(src->value.u16), (uint16_t *) dst);
>
> I thought you were going to add helpers like put_le16() to shared/util.h
> first?

My understanding of our discussion in the IRC was that put_uuid()
could be implemented inside src/gatt.c for now.
Anyway, I will send a new patchset moving put_uuid() and put_le16() to
src/shared/util.h

Regarding the remaining put_leX(), get_leX() (and related helpers) we
can start moving to src/shared/util.h after this patchset.

>
>> +static struct btd_attribute *new_const_attribute(const bt_uuid_t *type,
>> +                                                     const uint8_t *value,
>> +                                                     uint16_t len)
>> +{
>> +     struct btd_attribute *attr = malloc0(sizeof(struct btd_attribute) +
>> +                                                                     len);
>
> First of all I think it'd be better (coding style consistency-wise) to
> do the allocation separately from the declaration of the variable.
> Secondly, malloc0 can return NULL (unlike g_malloc0) so you'd need to
> check for that.

OK. I will fix it.

Claudio.
--
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