Page MenuHomeFreeBSD

D6848.id17600.diff
No OneTemporary

D6848.id17600.diff

Index: include/bitstring.h
===================================================================
--- include/bitstring.h
+++ include/bitstring.h
@@ -31,6 +31,7 @@
#include <stdlib.h>
#include <strings.h>
+#include <sys/param.h>
#include <sys/bitstring.h>
#endif /* _BITSTRING_H_ */
Index: sys/sys/bitstring.h
===================================================================
--- sys/sys/bitstring.h
+++ sys/sys/bitstring.h
@@ -65,6 +65,7 @@
#ifdef _KERNEL
#include <sys/libkern.h>
#include <sys/malloc.h>
+#include <sys/param.h>
#endif
#include <sys/types.h>
@@ -105,8 +106,7 @@
/*----------------------------- Public Interface -----------------------------*/
/* Number of bytes consumed by a bit string of nbits bits */
-#define bitstr_size(_nbits) \
- (((_nbits) + _BITSTR_BITS - 1) / 8)
+#define bitstr_size(_nbits) (roundup2((_nbits), 8))
/* Allocate a bit string initialized with no bits set. */
#ifdef _KERNEL
@@ -125,7 +125,7 @@
/* Allocate a bit string on the stack with no bits set. */
#define bit_decl(name, nbits) \
- ((name)[bitstr_size(nbits) / sizeof(bitstr_t)])
+ ((name)[roundup2(bitstr_size(nbits), sizeof(bitstr_t))])
/* Is bit N of bit string set? */
static inline int

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 14, 4:16 AM (18 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29651223
Default Alt Text
D6848.id17600.diff (1 KB)

Event Timeline