summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMikhail Kshevetskiy <[email protected]>2026-07-03 14:56:10 +0300
committerTom Rini <[email protected]>2026-07-08 13:29:18 -0600
commitab447ac61782bad20b73bd9e19dcadb255c27f8a (patch)
tree953eda8013ecfd66b18fb6ee2ad5abfa802c28b2 /include/linux
parent08badbd7d82c2f1e69051f110cd8966e4bfd573d (diff)
bitops: import BITS_PER_TYPE() macro from linux
This macro will be used by include/linux/bitfield.h header. Signed-off-by: Mikhail Kshevetskiy <[email protected]> Reviewed-by: David Lechner <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bitops.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 29e0da48de8..52eea4f8380 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -15,6 +15,7 @@
#define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG))
#define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG)
#define BITS_PER_BYTE 8
+#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE)
#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
#endif