genirq: Fix the return type of kstat_cpu_irqs_sum()
authorZhen Lei <thunder.leizhen@huawei.com>
Sat, 19 Nov 2022 09:25:03 +0000 (17:25 +0800)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 4 Jan 2023 01:51:38 +0000 (17:51 -0800)
commit47904aed898a08f028572b9b5a5cc101ddfb2d82
treecda9f44a69794606c63398bd82c340c71e19ee32
parent1b929c02afd37871d5afb9d498426f83432e71c2
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) <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>
include/linux/kernel_stat.h