mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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>
This commit is contained in:
parent
a9e8641f4c
commit
13e79b4622
1 changed files with 2 additions and 5 deletions
|
@ -567,13 +567,10 @@ static uint32_t extract_dc(unsigned short addr, int data)
|
||||||
datalo = ((unsigned long long)datalohi << 32) | datalolo;
|
datalo = ((unsigned long long)datalohi << 32) | datalolo;
|
||||||
ecc = dc_ecc(datalo);
|
ecc = dc_ecc(datalo);
|
||||||
if (ecc != datahi) {
|
if (ecc != datahi) {
|
||||||
int bits = 0;
|
int bits;
|
||||||
bad_ecc |= 1 << (3-offset);
|
bad_ecc |= 1 << (3-offset);
|
||||||
ecc ^= datahi;
|
ecc ^= datahi;
|
||||||
while (ecc) {
|
bits = hweight8(ecc);
|
||||||
if (ecc & 1) bits++;
|
|
||||||
ecc >>= 1;
|
|
||||||
}
|
|
||||||
res |= (bits == 1) ? CP0_CERRD_DATA_SBE : CP0_CERRD_DATA_DBE;
|
res |= (bits == 1) ? CP0_CERRD_DATA_SBE : CP0_CERRD_DATA_DBE;
|
||||||
}
|
}
|
||||||
printk(" %02X-%016llX", datahi, datalo);
|
printk(" %02X-%016llX", datahi, datalo);
|
||||||
|
|
Loading…
Reference in a new issue