Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] i386: change the 'no_control' field to 'hotpluggable' in the struct cpu

Change the 'no_control' field in the cpu struct to a more positive
and better term 'hotpluggable'. And change(/cleanup) the logic accordingly.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@suse.de>
Cc: "Li, Shaohua" <shaohua.li@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>

authored by

Siddha, Suresh B and committed by
Andi Kleen
72486f1f fd6d7d26

+14 -14
+2 -2
arch/i386/kernel/topology.c
··· 44 44 * Also certain PCI quirks require not to enable hotplug control 45 45 * for all CPU's. 46 46 */ 47 - if (!num || !enable_cpu_hotplug) 48 - cpu_devices[num].cpu.no_control = 1; 47 + if (num && enable_cpu_hotplug) 48 + cpu_devices[num].cpu.hotpluggable = 1; 49 49 50 50 return register_cpu(&cpu_devices[num].cpu, num); 51 51 }
+4 -4
arch/ia64/kernel/topology.c
··· 31 31 { 32 32 #if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU) 33 33 /* 34 - * If CPEI cannot be re-targetted, and this is 35 - * CPEI target, then dont create the control file 34 + * If CPEI can be re-targetted or if this is not 35 + * CPEI target, then it is hotpluggable 36 36 */ 37 - if (!can_cpei_retarget() && is_cpu_cpei_target(num)) 38 - sysfs_cpus[num].cpu.no_control = 1; 37 + if (can_cpei_retarget() || !is_cpu_cpei_target(num)) 38 + sysfs_cpus[num].cpu.hotpluggable = 1; 39 39 map_cpu_to_node(num, node_cpuid[num].nid); 40 40 #endif 41 41
+4 -4
arch/powerpc/kernel/sysfs.c
··· 239 239 struct cpu *c = &per_cpu(cpu_devices, cpu); 240 240 struct sys_device *s = &c->sysdev; 241 241 242 - BUG_ON(c->no_control); 242 + BUG_ON(!c->hotpluggable); 243 243 244 244 if (!firmware_has_feature(FW_FEATURE_ISERIES) && 245 245 cpu_has_feature(CPU_FTR_SMT)) ··· 424 424 * CPU. For instance, the boot cpu might never be valid 425 425 * for hotplugging. 426 426 */ 427 - if (!ppc_md.cpu_die) 428 - c->no_control = 1; 427 + if (ppc_md.cpu_die) 428 + c->hotpluggable = 1; 429 429 430 - if (cpu_online(cpu) || (c->no_control == 0)) { 430 + if (cpu_online(cpu) || c->hotpluggable) { 431 431 register_cpu(c, cpu); 432 432 433 433 sysdev_create_file(&c->sysdev, &attr_physical_id);
+3 -3
drivers/base/cpu.c
··· 104 104 105 105 /* 106 106 * register_cpu - Setup a driverfs device for a CPU. 107 - * @cpu - Callers can set the cpu->no_control field to 1, to indicate not to 108 - * generate a control file in sysfs for this CPU. 107 + * @cpu - cpu->hotpluggable field set to 1 will generate a control file in 108 + * sysfs for this CPU. 109 109 * @num - CPU number to use when creating the device. 110 110 * 111 111 * Initialize and register the CPU device. ··· 119 119 120 120 error = sysdev_register(&cpu->sysdev); 121 121 122 - if (!error && !cpu->no_control) 122 + if (!error && cpu->hotpluggable) 123 123 register_cpu_control(cpu); 124 124 if (!error) 125 125 cpu_sys_devices[num] = &cpu->sysdev;
+1 -1
include/linux/cpu.h
··· 27 27 28 28 struct cpu { 29 29 int node_id; /* The node which contains the CPU */ 30 - int no_control; /* Should the sysfs control file be created? */ 30 + int hotpluggable; /* creates sysfs control file if hotpluggable */ 31 31 struct sys_device sysdev; 32 32 }; 33 33