Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754900AbZKMHG7 (ORCPT ); Fri, 13 Nov 2009 02:06:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754712AbZKMHGz (ORCPT ); Fri, 13 Nov 2009 02:06:55 -0500 Received: from mail-yx0-f187.google.com ([209.85.210.187]:54709 "EHLO mail-yx0-f187.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754793AbZKMHGy (ORCPT ); Fri, 13 Nov 2009 02:06:54 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=i9xs4h5mrq7203dyZjBp5cGOkUT37whd9gYFSln+2WRNZaYBLHJir0sj0YuOszutiM fBLdH6daeLuIGHrqxhlD2ODrjbYireP1ynz8J5Wqxva6pTqfgKCJ7Xg/0nT5W+bwSgeG ZY8WnyNOKRSIV0bAf8iJZZJsFfa9ZhzWbEbww= From: Akinobu Mita To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org Cc: Akinobu Mita , Anders Larsen , Al Viro Subject: [PATCH] qnx4: Use hweight8 Date: Fri, 13 Nov 2009 16:06:18 +0900 Message-Id: <1258095978-13380-1-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.6.5.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1105 Lines: 45 Use hweight8 instead of counting for each bit Signed-off-by: Akinobu Mita Cc: Anders Larsen Cc: Al Viro --- fs/qnx4/bitmap.c | 17 +---------------- 1 files changed, 1 insertions(+), 16 deletions(-) diff --git a/fs/qnx4/bitmap.c b/fs/qnx4/bitmap.c index 0afba06..b913e3d 100644 --- a/fs/qnx4/bitmap.c +++ b/fs/qnx4/bitmap.c @@ -35,22 +35,7 @@ static void count_bits(register const char *bmPart, register int size, } do { b = *bmPart++; - if ((b & 1) == 0) - tot++; - if ((b & 2) == 0) - tot++; - if ((b & 4) == 0) - tot++; - if ((b & 8) == 0) - tot++; - if ((b & 16) == 0) - tot++; - if ((b & 32) == 0) - tot++; - if ((b & 64) == 0) - tot++; - if ((b & 128) == 0) - tot++; + tot += hweight8(b); size--; } while (size != 0); *tf = tot; -- 1.6.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/