x86/mmiotrace: Use cpumask_available() for cpumask_var_t variables

When building with Clang + -Wtautological-compare and
CONFIG_CPUMASK_OFFSTACK unset:

arch/x86/mm/mmio-mod.c:375:6: warning: comparison of array 'downed_cpus'
equal to a null pointer is always false [-Wtautological-pointer-compare]
if (downed_cpus == NULL &&
^~~~~~~~~~~ ~~~~
arch/x86/mm/mmio-mod.c:405:6: warning: comparison of array 'downed_cpus'
equal to a null pointer is always false [-Wtautological-pointer-compare]
if (downed_cpus == NULL || cpumask_weight(downed_cpus) == 0)
^~~~~~~~~~~ ~~~~
2 warnings generated.

Commit

f7e30f01a9e2 ("cpumask: Add helper cpumask_available()")

added cpumask_available() to fix warnings of this nature. Use that here
so that clang does not warn regardless of CONFIG_CPUMASK_OFFSTACK's
value.

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://github.com/ClangBuiltLinux/linux/issues/982
Link: https://lkml.kernel.org/r/20200408205323.44490-1-natechancellor@gmail.com

authored by Nathan Chancellor and committed by Borislav Petkov d7110a26 b9bbe6ed

Changed files
+2 -2
arch
x86
+2 -2
arch/x86/mm/mmio-mod.c
··· 372 372 int cpu; 373 373 int err; 374 374 375 - if (downed_cpus == NULL && 375 + if (!cpumask_available(downed_cpus) && 376 376 !alloc_cpumask_var(&downed_cpus, GFP_KERNEL)) { 377 377 pr_notice("Failed to allocate mask\n"); 378 378 goto out; ··· 402 402 int cpu; 403 403 int err; 404 404 405 - if (downed_cpus == NULL || cpumask_weight(downed_cpus) == 0) 405 + if (!cpumask_available(downed_cpus) || cpumask_weight(downed_cpus) == 0) 406 406 return; 407 407 pr_notice("Re-enabling CPUs...\n"); 408 408 for_each_cpu(cpu, downed_cpus) {