diff options
author | pjd <pjd@FreeBSD.org> | 2005-08-19 22:13:09 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-08-19 22:13:09 +0000 |
commit | 94bc690fb5dab9ce2259bca563c83e1457603512 (patch) | |
tree | 0a1e817aa8b8fb347dafbaab5238a85c9fb3fe93 /sbin/geom/class/raid3 | |
parent | 863deb3c00d07683cfba7aca2e35643099e42dd7 (diff) | |
download | FreeBSD-src-94bc690fb5dab9ce2259bca563c83e1457603512.zip FreeBSD-src-94bc690fb5dab9ce2259bca563c83e1457603512.tar.gz |
Move function for calculating number of bits into more central place.
I want to use it so more.
MFC after: 3 days
Diffstat (limited to 'sbin/geom/class/raid3')
-rw-r--r-- | sbin/geom/class/raid3/geom_raid3.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/sbin/geom/class/raid3/geom_raid3.c b/sbin/geom/class/raid3/geom_raid3.c index bef8424..7a8527f 100644 --- a/sbin/geom/class/raid3/geom_raid3.c +++ b/sbin/geom/class/raid3/geom_raid3.c @@ -155,12 +155,7 @@ raid3_label(struct gctl_req *req) gctl_error(req, "Too few arguments."); return; } -#ifndef BITCOUNT -#define BITCOUNT(x) (((BX_(x) + (BX_(x) >> 4)) & 0x0F0F0F0F) % 255) -#define BX_(x) ((x) - (((x) >> 1) & 0x77777777) - \ - (((x) >> 2) & 0x33333333) - (((x) >> 3) & 0x11111111)) -#endif - if (BITCOUNT(*nargs - 2) != 1) { + if (bitcount32(*nargs - 2) != 1) { gctl_error(req, "Invalid number of components."); return; } |