summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2022-11-19 17:25:03 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-11 16:31:35 +0100
commitb84d49628b0fcb1c4925b565ccfeb50a0b0f4630 (patch)
treecb0358ffa52b5f9e7dbbddecea265661e2e3020b /include/linux
parente2bc6ee13ddc737778258793596e2e8f1a104fa0 (diff)
downloadlinux-stable-b84d49628b0fcb1c4925b565ccfeb50a0b0f4630.tar.gz
linux-stable-b84d49628b0fcb1c4925b565ccfeb50a0b0f4630.tar.bz2
linux-stable-b84d49628b0fcb1c4925b565ccfeb50a0b0f4630.zip
genirq: Fix the return type of kstat_cpu_irqs_sum()
[ Upstream commit 47904aed898a08f028572b9b5a5cc101ddfb2d82 ] 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) <elliott@hpe.com> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Cc: Tejun Heo <tj@kernel.org> Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org> Cc: Josh Don <joshdon@google.com> Cc: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
-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 7ee2bb43b251..f7f20cf1bd3b 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -73,7 +73,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;
}