MIPS: TXx9: Fix possible overflow in clock calculations
commite4db168522b5660df580de728019e93bf94e5e49
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Thu, 2 Apr 2009 16:01:21 +0000 (3 01:01 +0900)
committerRalf Baechle <ralf@linux-mips.org>
Sun, 19 Apr 2009 02:26:43 +0000 (19 04:26 +0200)
tree993e4c44a476a9485dd7f92e2654e782fc12e967
parent135958edaef2b5b61c5a56a46d67246ecbdaa04a
MIPS: TXx9: Fix possible overflow in clock calculations

Addition of -fwrapv option in 2.6.29 discloses possible overflow with
signed arithmetics.  For example, result of "a * 6 / 12" (int a =
400000000) is 200000000 without -fwrapv but -157913941 with -fwrapv.

Change some variable to unsigned to avoid such overflows.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/txx9/generic/setup_tx4927.c
arch/mips/txx9/generic/setup_tx4938.c
arch/mips/txx9/generic/setup_tx4939.c