sched/core: fix build warning without CONFIG_CPUMASK_OFFSTACK 65/292565/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 3 May 2023 06:59:07 +0000 (15:59 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 8 May 2023 09:36:00 +0000 (18:36 +0900)
Without CONFIG_CPUMASK_OFFSTACK, checking the address of the
cpumask_var_t gives warning. To resolve the warning, use
cpumask_available() instead of checking the pointer directly.

Change-Id: I00b5a90015a304a4b1151afd1074acf9c542cb55
Ref: commit e78c59fda86c ("cpumask: Add helper cpumask_available()")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
kernel/sched/core.c

index caac2f5..eb7fe7a 100644 (file)
@@ -8267,7 +8267,7 @@ void __init sched_init(void)
 #ifdef CONFIG_SMP
        zalloc_cpumask_var(&sched_domains_tmpmask, GFP_NOWAIT);
        /* May be allocated at isolcpus cmdline parse time */
-       if (cpu_isolated_map == NULL)
+       if (!cpumask_available(cpu_isolated_map))
                zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
        idle_thread_set_boot_cpu();
        set_cpu_rq_start_time(smp_processor_id());