rt-tests: cyclictest: Fix warning: ‘cpu’ may be used uninitialized

Fix warning 'cpu' maybe uninitialized by giving it a default value in
the switch statement. Note, this is a false positive, but documenting
the default value in the switch statement isn't a bad thing.

Signed-off-by: John Kacur <jkacur@redhat.com>
This commit is contained in:
John Kacur 2019-09-16 21:06:28 +02:00
parent e257955f45
commit 558b1c2760
1 changed files with 1 additions and 0 deletions

View File

@ -1897,6 +1897,7 @@ int main(int argc, char **argv)
printf("Thread %d using cpu %d.\n", i, cpu);
break;
case AFFINITY_USEALL: cpu = i % max_cpus; break;
default: cpu = -1;
}
node = -1;