Re: [PATCHv6 hcidump 2/4] add fixed channel definitions

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

 



Hi Andrei,

On Fri, Oct 21, 2011, Emeltchenko Andrei wrote:
> Would the following code be OK?
> 
> diff --git a/lib/bluetooth.h b/lib/bluetooth.h
> index b0680e2..158103b 100644
> --- a/lib/bluetooth.h
> +++ b/lib/bluetooth.h
> @@ -125,6 +125,30 @@ do {                                               \
>         __p->__v = (val);                       \
>  } while(0)
>  
> +#if __BYTE_ORDER == __LITTLE_ENDIAN
> +inline uint64_t bt_get_le64(void *ptr)
> +{
> +       return bt_get_unaligned((uint64_t *) ptr);
> +}
> +
> +inline uint64_t bt_get_be64(void *ptr)
> +{
> +       return bswap_64(bt_get_unaligned((uint64_t *) ptr));
> +}
> +#elif __BYTE_ORDER == __BIG_ENDIAN
> +inline uint64_t bt_get_le64(void *ptr)
> +{
> +       return bswap_64(bt_get_unaligned((uint64_t *) ptr));
> +}
> +
> +inline uint64_t bt_get_be64(void *ptr)
> +{
> +       return bt_get_unaligned((uint64_t *) ptr);
> +}
> +#else
> +#error "Unknown byte order"
> +#endif
> +

Yes, I think that would be fine, but please also add the same for 32 and
16 bit integers.

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