提交 13e79b46 编写于 作者: A Akinobu Mita 提交者: Ralf Baechle

MIPS: Sibyte: Use hweight8 instead of counting bits

Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/637/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 a9e8641f
......@@ -567,13 +567,10 @@ static uint32_t extract_dc(unsigned short addr, int data)
datalo = ((unsigned long long)datalohi << 32) | datalolo;
ecc = dc_ecc(datalo);
if (ecc != datahi) {
int bits = 0;
int bits;
bad_ecc |= 1 << (3-offset);
ecc ^= datahi;
while (ecc) {
if (ecc & 1) bits++;
ecc >>= 1;
}
bits = hweight8(ecc);
res |= (bits == 1) ? CP0_CERRD_DATA_SBE : CP0_CERRD_DATA_DBE;
}
printk(" %02X-%016llX", datahi, datalo);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册