Module Name: src
Committed By: riastradh
Date: Sun Dec 19 09:49:47 UTC 2021
Modified Files:
src/sys/external/bsd/common/include/linux: bitops.h
Log Message:
provide BITS_PER_TYPE
Author: Maya Rashish <[email protected]>
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/common/include/linux/bitops.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/common/include/linux/bitops.h
diff -u src/sys/external/bsd/common/include/linux/bitops.h:1.14 src/sys/external/bsd/common/include/linux/bitops.h:1.15
--- src/sys/external/bsd/common/include/linux/bitops.h:1.14 Sun Dec 19 09:44:27 2021
+++ src/sys/external/bsd/common/include/linux/bitops.h Sun Dec 19 09:49:47 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: bitops.h,v 1.14 2021/12/19 09:44:27 riastradh Exp $ */
+/* $NetBSD: bitops.h,v 1.15 2021/12/19 09:49:47 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -106,8 +106,9 @@ sign_extend64(uint64_t x, unsigned n)
#define BITS_TO_LONGS(n) \
roundup2((n), (sizeof(unsigned long) * CHAR_BIT))
-#define BITS_PER_BYTE NBBY
-#define BITS_PER_LONG (__SIZEOF_LONG__ * CHAR_BIT)
+#define BITS_PER_TYPE(type) (sizeof(type) * NBBY)
+#define BITS_PER_BYTE NBBY
+#define BITS_PER_LONG (__SIZEOF_LONG__ * CHAR_BIT)
#define BIT(n) ((unsigned long)__BIT(n))
#define BIT_ULL(n) ((unsigned long long)__BIT(n))