Skip to content

Commit 397935e

Browse files
committed
Merge tag 'smp-core-2024-03-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull cpu core updates from Thomas Gleixner: "A small boring set of cleanups for the SMP and CPU hotplug code" * tag 'smp-core-2024-03-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: cpu: Remove stray semicolon smp: Make __smp_processor_id() 0-argument macro cpu: Mark cpu_possible_mask as __ro_after_init kernel/cpu: Convert snprintf() to sysfs_emit() cpu/hotplug: Delete an extraneous kernel-doc description
2 parents 4527e83 + 266e957 commit 397935e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

include/linux/smp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ static inline int get_boot_cpu_id(void)
261261
* regular asm read for the stable.
262262
*/
263263
#ifndef __smp_processor_id
264-
#define __smp_processor_id(x) raw_smp_processor_id(x)
264+
#define __smp_processor_id() raw_smp_processor_id()
265265
#endif
266266

267267
#ifdef CONFIG_DEBUG_PREEMPT

kernel/cpu.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
* @rollback: Perform a rollback
5555
* @single: Single callback invocation
5656
* @bringup: Single callback bringup or teardown selector
57-
* @cpu: CPU number
5857
* @node: Remote CPU node; for multi-instance, do a
5958
* single entry callback for install/remove
6059
* @last: For multi-instance rollback, remember how far we got
@@ -3005,7 +3004,7 @@ static ssize_t control_show(struct device *dev,
30053004
return sysfs_emit(buf, "%d\n", cpu_smt_num_threads);
30063005
#endif
30073006

3008-
return snprintf(buf, PAGE_SIZE - 2, "%s\n", state);
3007+
return sysfs_emit(buf, "%s\n", state);
30093008
}
30103009

30113010
static ssize_t control_store(struct device *dev, struct device_attribute *attr,
@@ -3018,7 +3017,7 @@ static DEVICE_ATTR_RW(control);
30183017
static ssize_t active_show(struct device *dev,
30193018
struct device_attribute *attr, char *buf)
30203019
{
3021-
return snprintf(buf, PAGE_SIZE - 2, "%d\n", sched_smt_active());
3020+
return sysfs_emit(buf, "%d\n", sched_smt_active());
30223021
}
30233022
static DEVICE_ATTR_RO(active);
30243023

@@ -3107,10 +3106,10 @@ const DECLARE_BITMAP(cpu_all_bits, NR_CPUS) = CPU_BITS_ALL;
31073106
EXPORT_SYMBOL(cpu_all_bits);
31083107

31093108
#ifdef CONFIG_INIT_ALL_POSSIBLE
3110-
struct cpumask __cpu_possible_mask __read_mostly
3109+
struct cpumask __cpu_possible_mask __ro_after_init
31113110
= {CPU_BITS_ALL};
31123111
#else
3113-
struct cpumask __cpu_possible_mask __read_mostly;
3112+
struct cpumask __cpu_possible_mask __ro_after_init;
31143113
#endif
31153114
EXPORT_SYMBOL(__cpu_possible_mask);
31163115

0 commit comments

Comments
 (0)