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 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?

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

Johan
--
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