sched: fix build when NR_CPUS == 1
authorJan Beulich <jbeulich@suse.com>
Tue, 2 Mar 2021 11:29:16 +0000 (12:29 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 2 Mar 2021 11:29:16 +0000 (12:29 +0100)
commit2de43f834ad2d758dd7b3441a6d1398491f18eae
tree4e5621f99292f17193fd0260b3cfe0c516cb0f21
parent9bd9695a8bc72a86b98c0683736d2310838558fe
sched: fix build when NR_CPUS == 1

In this case the compiler is recognizing that no valid array indexes
remain, and hence e.g. reports:

core.c: In function 'cpu_schedule_up':
core.c:2769:19: error: array subscript 1 is above array bounds
of 'struct vcpu *[1]' [-Werror=array-bounds]
 2769 |     if ( idle_vcpu[cpu] == NULL )
      |          ~~~~~~~~~^~~~~

Reported-by: Connor Davis <connojdavis@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
xen/common/sched/core.c