Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Sibyte: Use hweight8 instead of counting bits

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/637/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Akinobu Mita and committed by
Ralf Baechle
13e79b46 a9e8641f

+2 -5
+2 -5
arch/mips/mm/cerr-sb1.c
··· 567 567 datalo = ((unsigned long long)datalohi << 32) | datalolo; 568 568 ecc = dc_ecc(datalo); 569 569 if (ecc != datahi) { 570 - int bits = 0; 570 + int bits; 571 571 bad_ecc |= 1 << (3-offset); 572 572 ecc ^= datahi; 573 - while (ecc) { 574 - if (ecc & 1) bits++; 575 - ecc >>= 1; 576 - } 573 + bits = hweight8(ecc); 577 574 res |= (bits == 1) ? CP0_CERRD_DATA_SBE : CP0_CERRD_DATA_DBE; 578 575 } 579 576 printk(" %02X-%016llX", datahi, datalo);