diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2018-06-20 02:58:29 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-06-27 11:58:49 -0400 |
commit | 37a3862e1238262e9866d5d66e5f5f9069cee3a1 (patch) | |
tree | 10be8fde046be1efc4316dbfd055d0e5f8b4d4d3 /include/linux/bitfield.h | |
parent | e7d4a95da86e0b048702765bbdcdc968aaf312e7 (diff) |
bitfield: add u8 helpers
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>
Diffstat (limited to 'include/linux/bitfield.h')
-rw-r--r-- | include/linux/bitfield.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h index 147a7bb341dd..65a6981eef7b 100644 --- a/include/linux/bitfield.h +++ b/include/linux/bitfield.h | |||
@@ -143,6 +143,7 @@ static __always_inline base type##_get_bits(__##type v, base field) \ | |||
143 | ____MAKE_OP(le##size,u##size,cpu_to_le##size,le##size##_to_cpu) \ | 143 | ____MAKE_OP(le##size,u##size,cpu_to_le##size,le##size##_to_cpu) \ |
144 | ____MAKE_OP(be##size,u##size,cpu_to_be##size,be##size##_to_cpu) \ | 144 | ____MAKE_OP(be##size,u##size,cpu_to_be##size,be##size##_to_cpu) \ |
145 | ____MAKE_OP(u##size,u##size,,) | 145 | ____MAKE_OP(u##size,u##size,,) |
146 | ____MAKE_OP(u8,u8,,) | ||
146 | __MAKE_OP(16) | 147 | __MAKE_OP(16) |
147 | __MAKE_OP(32) | 148 | __MAKE_OP(32) |
148 | __MAKE_OP(64) | 149 | __MAKE_OP(64) |