Skip to content

Commit 47904ae

Browse files
Zhen Leipaulmckrcu
authored andcommitted
genirq: Fix the return type of kstat_cpu_irqs_sum()
The type of member ->irqs_sum is unsigned long, but kstat_cpu_irqs_sum() returns int, which can result in truncation. Therefore, change the kstat_cpu_irqs_sum() function's return value to unsigned long to avoid truncation. Fixes: f2c66cd ("/proc/stat: scalability of irq num per cpu") Reported-by: Elliott, Robert (Servers) <[email protected]> Signed-off-by: Zhen Lei <[email protected]> Cc: Tejun Heo <[email protected]> Cc: "Peter Zijlstra (Intel)" <[email protected]> Cc: Josh Don <[email protected]> Cc: Andrew Morton <[email protected]> Reviewed-by: Frederic Weisbecker <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 1b929c0 commit 47904ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/kernel_stat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ extern unsigned int kstat_irqs_usr(unsigned int irq);
7575
/*
7676
* Number of interrupts per cpu, since bootup
7777
*/
78-
static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu)
78+
static inline unsigned long kstat_cpu_irqs_sum(unsigned int cpu)
7979
{
8080
return kstat_cpu(cpu).irqs_sum;
8181
}

0 commit comments

Comments
 (0)