MIPS: Use unsigned int when reading CP0 registers
MIPS: Use unsigned int when reading CP0 registers

Update __read_32bit_c0_register() and __read_32bit_c0_ctrl_register() to
use "unsigned int res;" instead of "int res;". There is little reason to
treat these register values as signed. They are either counters (which
by definition are unsigned) or are made up of various bit fields to be
interpreted as per the CPU datasheet.

This has come up via u-boot[1] which sync's asm/mipsregs.h with the
kernel. In u-boots case the value read from read_c0_count() is assigned
to an unsigned long [2] which triggers a sign extension and causes a
bug.

U-boot should probably be more explicit about the types used for the
timer_read_counter() API but that aside is there any reason to treat
these values as signed integers? A quick grep around the arch/mips makes
me thing that there may be some bugs lurking when read_c0_count() starts
to yield a negative value but I haven't really explored any of them.

[1] - http://lists.denx.de/pipermail/u-boot/2015-July/219086.html
[2] - http://git.denx.de/?p=u-boot.git;a=blob;f=arch/mips/cpu/time.c#l11

Signed-off-by: Chris Packham <f6ce1e3a84979f774d08cfcf0135fdab4b721a81@gmail.com>
Cc: 562397917b9a8bf316569a848858b12fb417723f@linux-mips.org
Cc: Daniel Schwierzeck <3cf560e45ce26493f30d612eabbc04221340fe03@gmail.com>
Cc: Chris Packham <f6ce1e3a84979f774d08cfcf0135fdab4b721a81@gmail.com>
Cc: Steven J. Hill <65de785d8c782d8fbc3c121e7b1bdd045e15ee49@imgtec.com>
Cc: Maciej W. Rozycki <78f3a3d9d6e4d907a7d12e475d0a751d6b7e256b@linux-mips.org>
Cc: 2578944098299abf708b08eff6fcf60565553586@vger.kernel.org
Cc: James Hogan <547fa85bb3888a0222eed8ec39e36708605c6d53@imgtec.com>
Cc: Markos Chandras <5cdbcb0e11d2b5ebc39222958c54a1c6329d0c9d@imgtec.com>
Cc: Paul Burton <85f1bffadddedccfafc0ae065a06aa636075387f@imgtec.com>
Patchwork: https://patchwork.linux-mips.org/patch/10718/
Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs