diff options
| author | riastradh <riastradh@NetBSD.org> | 2018-08-27 13:54:37 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2018-08-27 13:54:37 +0000 |
| commit | fa24d0d550dcd17a5cc7a082e1a35977ed66f8be (patch) | |
| tree | e6c505a04b284be5af3f9af8c5f0bfac7a74655a /sys/external/bsd/common/include/linux/bitops.h | |
| parent | 5fc475cfdcacde96e228fc62428244c675bdbd7e (diff) | |
Move hweight8 next to its cousins.
Diffstat (limited to 'sys/external/bsd/common/include/linux/bitops.h')
| -rw-r--r-- | sys/external/bsd/common/include/linux/bitops.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/external/bsd/common/include/linux/bitops.h b/sys/external/bsd/common/include/linux/bitops.h index a2aa6c3a9a0..509dbf73377 100644 --- a/sys/external/bsd/common/include/linux/bitops.h +++ b/sys/external/bsd/common/include/linux/bitops.h @@ -1,4 +1,4 @@ -/* $NetBSD: bitops.h,v 1.6 2018/08/27 07:16:50 riastradh Exp $ */ +/* $NetBSD: bitops.h,v 1.7 2018/08/27 13:54:37 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -73,6 +73,12 @@ fls(int x) } static inline unsigned int +hweight8(uint8_t w) +{ + return popcount(w & 0xff); +} + +static inline unsigned int hweight16(uint16_t n) { return popcount32(n); @@ -257,11 +263,4 @@ find_first_zero_bit(const unsigned long *ptr, unsigned long nbits) (BIT) < (NBITS); \ (BIT) = find_next_bit((PTR), (NBITS), (BIT) + 1)) -static inline unsigned -hweight8(unsigned w) -{ - - return popcount(w & 0xff); -} - #endif /* _LINUX_BITOPS_H_ */ |
