Received: from milmhbs1.lsil.com (147.145.21.209) by coscas01.lsi.com
 (172.21.36.60) with Microsoft SMTP Server id 8.1.393.1; Fri, 13 Nov 2009
 00:06:27 -0700
Received: from mail1.lsil.com (mail1.lsil.com [147.145.40.21])	by
 milmhbs1.lsil.com (8.12.11/8.12.11) with ESMTP id nAD76RKU024542	for
 <andy.sharp@lsi.com>; Thu, 12 Nov 2009 23:06:27 -0800
Received: from psmtp.com (na3sys009amx213.postini.com [74.125.149.53])	by
 mail1.lsil.com (8.12.11/8.12.11) with SMTP id nAD76PjX002862	for
 <andy.sharp@lsi.com>; Thu, 12 Nov 2009 23:06:26 -0800 (PST)
Received: from source ([78.24.191.182]) by na3sys009amx213.postini.com
 ([74.125.148.14]) with SMTP;	Thu, 12 Nov 2009 23:06:26 PST
Received: from localhost.localdomain ([127.0.0.1]:45001 "EHLO
	eddie.linux-mips.org" rhost-flags-OK-OK-OK-FAIL) by ftp.linux-mips.org	with
 ESMTP id S1492094AbZKMHGI (ORCPT <rfc822;andy.sharp@lsi.com>);	Fri, 13 Nov
 2009 08:06:08 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 13 Nov 2009 08:05:51
 +0100 (CET)
Received: from mail-gx0-f212.google.com ([209.85.217.212]:42511 "EHLO
	mail-gx0-f212.google.com" rhost-flags-OK-OK-OK-OK)	by ftp.linux-mips.org with
 ESMTP id S1492130AbZKMHFo (ORCPT	<rfc822;linux-mips@linux-mips.org>); Fri, 13
 Nov 2009 08:05:44 +0100
Received: by gxk4 with SMTP id 4so3834948gxk.8        for <multiple
 recipients>; Thu, 12 Nov 2009 23:05:38 -0800 (PST)
Received: by 10.150.112.17 with SMTP id k17mr5836349ybc.257.1258095935597;
        Thu, 12 Nov 2009 23:05:35 -0800 (PST)
Received: from localhost ([220.110.185.192])        by mx.google.com with
 ESMTPS id 4sm257349ywi.42.2009.11.12.23.05.34        (version=TLSv1/SSLv3
 cipher=RC4-MD5);        Thu, 12 Nov 2009 23:05:34 -0800 (PST)
From: Akinobu Mita <akinobu.mita@gmail.com>
To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
CC: Akinobu Mita <akinobu.mita@gmail.com>, Ralf Baechle <ralf@linux-mips.org>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Fri, 13 Nov 2009 00:04:53 -0700
Subject: [PATCH] mips: Use hweight8
Thread-Topic: [PATCH] mips: Use hweight8
Thread-Index: AcpkL9H6qjZN9MkbRVunYqSRq74XeA==
Message-ID: <1258095893-13338-1-git-send-email-akinobu.mita@gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: coscas01.lsi.com
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-scanned-by: MIMEDefang 2.39
errors-to: linux-mips-bounce@linux-mips.org
x-pstn-levels: (S:34.46390/99.90000 CV:99.9000 FC:95.5390 LC:95.5390
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
x-pstn-settings: 3 (1.0000:1.0000) s cv gt3 gt2 gt1 r p m c 
x-pstn-addresses: from <akinobu.mita@gmail.com> [22/1] 
x-pstn-neptune: 0/0/0.00/0
domainkey-signature: a=rsa-sha1; c=nofws;        d=gmail.com; s=gamma;
        h=from:to:cc:subject:date:message-id:x-mailer;
        b=nWEjhFXs4kk+fZQEn5M76YhPE0C2Hc4SWLZ0l65s6f0RAOzzpjJPzF/hYiQ5H3cEZW
         fuStu1JlMMRthzbSps5PWHjQbv7Rbj63bOPK5a/VkT/YKyzp8nX//V5sAm0emBjL4/bz
         uDKfAp72HTp2O/Rr45EDcMVt5xZyP9ErLK+mI=
dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com;
 s=gamma;
        h=domainkey-signature:received:received:from:to:cc:subject:date
         :message-id:x-mailer;
        bh=hWaoejo14piY+iDKXTWpNDXA3HKlR9nR8fuo3SIggJs=;
        b=R6WnxyS5PxS5Ld0hW3yQBjFEpC2Ul8eQXoCrr5xaQJ5sX/mvMyxRQQvkNEwFixVlXm
         Tc95JlSfgkW0LPsaZ5qcPBlMBFNkibmY+3Mc+oXELooDb/tLdxY5rnKZrUMfo/ncf5w8
         5uos99EdrgwKqGxKOyeyF9+jJ9EUuoQYF5P1A=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

Use hweight8 instead of counting for each bit

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/mm/cerr-sb1.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/mips/mm/cerr-sb1.c b/arch/mips/mm/cerr-sb1.c
index 1bd1f18..3571090 100644
--- a/arch/mips/mm/cerr-sb1.c
+++ b/arch/mips/mm/cerr-sb1.c
@@ -567,13 +567,10 @@ static uint32_t extract_dc(unsigned short addr, int d=
ata)
 				datalo =3D ((unsigned long long)datalohi << 32) | datalolo;
 				ecc =3D dc_ecc(datalo);
 				if (ecc !=3D datahi) {
-					int bits =3D 0;
+					int bits;
 					bad_ecc |=3D 1 << (3-offset);
 					ecc ^=3D datahi;
-					while (ecc) {
-						if (ecc & 1) bits++;
-						ecc >>=3D 1;
-					}
+					bits =3D hweight8(ecc);
 					res |=3D (bits =3D=3D 1) ? CP0_CERRD_DATA_SBE : CP0_CERRD_DATA_DBE;
 				}
 				printk("  %02X-%016llX", datahi, datalo);
--=20
1.6.5.1


