From 94bc690fb5dab9ce2259bca563c83e1457603512 Mon Sep 17 00:00:00 2001 From: pjd Date: Fri, 19 Aug 2005 22:13:09 +0000 Subject: Move function for calculating number of bits into more central place. I want to use it so more. MFC after: 3 days --- sbin/geom/class/raid3/geom_raid3.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'sbin/geom/class/raid3/geom_raid3.c') 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; } -- cgit v1.1