mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-01 08:20:44 -05:00
hangcheck-timer: cleanup casting in hangcheck_init()
The 32 bit addition "(hangcheck_margin + hangcheck_tick)" could potentially overflow. It triggers a static checker warning to have an overflowed addition followed by a no-op cast. I have moved the cast so that the addition can't overflow. Also I removed the unneeded cast on the following line since both "hangcheck_tsc_margin" and "TIMER_FREQ" are already 64 bit types. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
d25221525e
commit
d0439a5442
1 changed files with 2 additions and 2 deletions
|
|
@ -168,8 +168,8 @@ static int __init hangcheck_init(void)
|
|||
printk("Hangcheck: starting hangcheck timer %s (tick is %d seconds, margin is %d seconds).\n",
|
||||
VERSION_STR, hangcheck_tick, hangcheck_margin);
|
||||
hangcheck_tsc_margin =
|
||||
(unsigned long long)(hangcheck_margin + hangcheck_tick);
|
||||
hangcheck_tsc_margin *= (unsigned long long)TIMER_FREQ;
|
||||
(unsigned long long)hangcheck_margin + hangcheck_tick;
|
||||
hangcheck_tsc_margin *= TIMER_FREQ;
|
||||
|
||||
hangcheck_tsc = ktime_get_ns();
|
||||
mod_timer(&hangcheck_ticktock, jiffies + (hangcheck_tick*HZ));
|
||||
|
|
|
|||
Loading…
Reference in a new issue