bitfield: add u8 helpers
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 20 Jun 2018 06:58:29 +0000 (08:58 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 27 Jun 2018 15:58:49 +0000 (18:58 +0300)
There's no reason why we shouldn't pack/unpack bits into/from
u8 values/registers/etc., so add u8 helpers.

Use the ____MAKE_OP() macro directly to avoid having nonsense
le8_encode_bits() and similar functions.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
include/linux/bitfield.h

index 147a7bb341dda9be2fd4c364398f1a13fb73fdab..65a6981eef7bf5109e44f083ff5fcbb0dc64e414 100644 (file)
@@ -143,6 +143,7 @@ static __always_inline base type##_get_bits(__##type v, base field) \
        ____MAKE_OP(le##size,u##size,cpu_to_le##size,le##size##_to_cpu) \
        ____MAKE_OP(be##size,u##size,cpu_to_be##size,be##size##_to_cpu) \
        ____MAKE_OP(u##size,u##size,,)
+____MAKE_OP(u8,u8,,)
 __MAKE_OP(16)
 __MAKE_OP(32)
 __MAKE_OP(64)