Hi Johan, On Wed, Jan 18, 2012 at 2:51 PM, Johan Hedberg <johan.hedberg@xxxxxxxxx> wrote: > +static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type, u8 *data, > + u16 data_len) > +{ > + eir[eir_len++] = sizeof(type) + data_len; Isn't it better to have data_len as u8? It is impossible for a EIR or AD entry to have more than 255 octets (given the length field is one octet). > + eir[eir_len++] = type; > + memcpy(&eir[eir_len], data, data_len); > + eir_len += data_len; > + > + return eir_len; > +} Regards, -- Anderson Lizardo Instituto Nokia de Tecnologia - INdT Manaus - Brazil -- 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