Hi Andrei, > > > > > + case 8: > > > > > + return btohll(bt_get_unaligned((uint64_t *) ptr)); > > > > > } > > > > > return 0; > > > > > } > > > > > > > > turning everything into a uint64 is a bit heavy. Just change this into > > > > broken down version. get_uint64, get_uint32, get_uint16 etc. Otherwise > > > > you keep casting yourself crazy. > > > > > > Yes, casting does not look nice. What about if I keep everything AS IS and > > > just use btohll(bt_get_unaligned((ptr)) to access 64 bit value. > > > > this does not make it more readable. Create helpers like get_uint64 for > > it. > > Is this OK: > > --- a/parser/parser.h > +++ b/parser/parser.h > ... > +static inline uint64_t get_uint64(void *ptr) > +{ > + return btohll(bt_get_unaligned((uint64_t *) ptr)); > +} > ... that would be fine with me. And if you wanna go all out, then you could fix the weird SDP big-endian conversion/handling that is lingering around the source code and all parsers for a while now. Maybe just something like get_le64, get_le32, get_be32 etc. Think about it a little bit and if you are up for some major cleanup task. Regards Marcel -- 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