aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhen Lei <[email protected]>2022-11-19 17:25:03 +0800
committerPaul E. McKenney <[email protected]>2023-01-03 17:51:38 -0800
commit47904aed898a08f028572b9b5a5cc101ddfb2d82 (patch)
treecda9f44a69794606c63398bd82c340c71e19ee32
parent1b929c02afd37871d5afb9d498426f83432e71c2 (diff)
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: f2c66cd8eedd ("/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]>
-rw-r--r--include/linux/kernel_stat.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index ddb5a358fd82..90e2fdc17d79 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -75,7 +75,7 @@ extern unsigned int kstat_irqs_usr(unsigned int irq);
/*
* Number of interrupts per cpu, since bootup
*/
-static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu)
+static inline unsigned long kstat_cpu_irqs_sum(unsigned int cpu)
{
return kstat_cpu(cpu).irqs_sum;
}