]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
printk: nbcon: Use raw_cpu_ptr() instead of open coding
authorJohn Ogness <john.ogness@linutronix.de>
Tue, 27 Aug 2024 14:19:31 +0000 (16:25 +0206)
committerPetr Mladek <pmladek@suse.com>
Wed, 4 Sep 2024 10:28:25 +0000 (12:28 +0200)
There is no need to open code a non-migration-checking
this_cpu_ptr(). That is exactly what raw_cpu_ptr() is.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/87plpum4jw.fsf@jogness.linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
kernel/printk/nbcon.c

index 92ac5c59092710b465a247504d6e89844fe4d823..cf62f675c67340a0024e7d9eb4b76aa83695912d 100644 (file)
@@ -998,8 +998,7 @@ static __ref unsigned int *nbcon_get_cpu_emergency_nesting(void)
        if (!printk_percpu_data_ready())
                return &early_nbcon_pcpu_emergency_nesting;
 
-       /* Open code this_cpu_ptr() without checking migration. */
-       return per_cpu_ptr(&nbcon_pcpu_emergency_nesting, raw_smp_processor_id());
+       return raw_cpu_ptr(&nbcon_pcpu_emergency_nesting);
 }
 
 /**