mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
sched/vtime: Work around an unitialized variable warning
Work around this warning: kernel/sched/cputime.c: In function ‘kcpustat_field’: kernel/sched/cputime.c:1007:6: warning: ‘val’ may be used uninitialized in this function [-Wmaybe-uninitialized] because GCC can't see that val is used only when err is 0. Acked-by: Peter Zijlstra <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
This commit is contained in:
1 parent
3662daf023
commit
e0d648f9d8
1 file changed
+2
-2
@@ -1003,12 +1003,12 @@ u64 kcpustat_field(struct kernel_cpustat *kcpustat,
|
||||
enum cpu_usage_stat usage, int cpu)
|
||||
{
|
||||
u64 *cpustat = kcpustat->cpustat;
|
||||
u64 val = cpustat[usage];
|
||||
struct rq *rq;
|
||||
u64 val;
|
||||
int err;
|
||||
|
||||
if (!vtime_accounting_enabled_cpu(cpu))
|
||||
return cpustat[usage];
|
||||
return val;
|
||||
|
||||
rq = cpu_rq(cpu);
|
||||
|
||||
|
||||
Reference in new issue
Block a user