diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2009-04-02 18:01:21 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-05-14 14:50:27 +0200 |
commit | 740ebe4a54fae1705705ec87ce511b16ffb50659 (patch) | |
tree | f560d2d8d01c6c85108ad01ae244d5e9a4dcee25 /arch/mips/txx9/generic/setup_tx4939.c | |
parent | MIPS: Synchronize dma_map_page and dma_map_single (diff) | |
download | linux-740ebe4a54fae1705705ec87ce511b16ffb50659.tar.xz linux-740ebe4a54fae1705705ec87ce511b16ffb50659.zip |
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>
Diffstat (limited to 'arch/mips/txx9/generic/setup_tx4939.c')
-rw-r--r-- | arch/mips/txx9/generic/setup_tx4939.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c index 7a25b573e9b0..c2bf150c8838 100644 --- a/arch/mips/txx9/generic/setup_tx4939.c +++ b/arch/mips/txx9/generic/setup_tx4939.c @@ -114,7 +114,7 @@ void __init tx4939_setup(void) int i; __u32 divmode; __u64 pcfg; - int cpuclk = 0; + unsigned int cpuclk = 0; txx9_reg_res_init(TX4939_REV_PCODE(), TX4939_REG_BASE, TX4939_REG_SIZE); |