diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-08 06:31:17 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-05-28 12:24:11 -0400 |
commit | cb491fca55e5282f0a95ef39c55352e00d6ca75e (patch) | |
tree | af378d383ec2bbb2aecc9d874365787c1545f4ce | |
parent | dba3725d44f5dfb5711fd509fca10b5b828c43b7 (diff) |
x86, mce: Rename sysfs variables
Shorten variable names. This also compacts the code a bit.
device_mce => mce_dev
mce_device_initialized => mce_dev_initialized
mce_attribute => mce_attrs
[ Impact: cleanup ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | arch/x86/include/asm/mce.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 58 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_amd_64.c | 10 |
3 files changed, 33 insertions, 37 deletions
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 8488210b866f..b9972a6bc2a1 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h | |||
@@ -90,7 +90,7 @@ extern int mce_disabled; | |||
90 | 90 | ||
91 | void mce_setup(struct mce *m); | 91 | void mce_setup(struct mce *m); |
92 | void mce_log(struct mce *m); | 92 | void mce_log(struct mce *m); |
93 | DECLARE_PER_CPU(struct sys_device, device_mce); | 93 | DECLARE_PER_CPU(struct sys_device, mce_dev); |
94 | extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); | 94 | extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); |
95 | 95 | ||
96 | /* | 96 | /* |
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 2e2c3d2e9586..ba8dd41a10dc 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -957,7 +957,7 @@ static struct sysdev_class mce_sysclass = { | |||
957 | .name = "machinecheck", | 957 | .name = "machinecheck", |
958 | }; | 958 | }; |
959 | 959 | ||
960 | DEFINE_PER_CPU(struct sys_device, device_mce); | 960 | DEFINE_PER_CPU(struct sys_device, mce_dev); |
961 | 961 | ||
962 | __cpuinitdata | 962 | __cpuinitdata |
963 | void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); | 963 | void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); |
@@ -1039,12 +1039,12 @@ static SYSDEV_INT_ATTR(tolerant, 0644, tolerant); | |||
1039 | 1039 | ||
1040 | ACCESSOR(check_interval, check_interval, mce_restart()) | 1040 | ACCESSOR(check_interval, check_interval, mce_restart()) |
1041 | 1041 | ||
1042 | static struct sysdev_attribute *mce_attributes[] = { | 1042 | static struct sysdev_attribute *mce_attrs[] = { |
1043 | &attr_tolerant.attr, &attr_check_interval, &attr_trigger, | 1043 | &attr_tolerant.attr, &attr_check_interval, &attr_trigger, |
1044 | NULL | 1044 | NULL |
1045 | }; | 1045 | }; |
1046 | 1046 | ||
1047 | static cpumask_var_t mce_device_initialized; | 1047 | static cpumask_var_t mce_dev_initialized; |
1048 | 1048 | ||
1049 | /* Per cpu sysdev init. All of the cpus still share the same ctrl bank: */ | 1049 | /* Per cpu sysdev init. All of the cpus still share the same ctrl bank: */ |
1050 | static __cpuinit int mce_create_device(unsigned int cpu) | 1050 | static __cpuinit int mce_create_device(unsigned int cpu) |
@@ -1055,40 +1055,36 @@ static __cpuinit int mce_create_device(unsigned int cpu) | |||
1055 | if (!mce_available(&boot_cpu_data)) | 1055 | if (!mce_available(&boot_cpu_data)) |
1056 | return -EIO; | 1056 | return -EIO; |
1057 | 1057 | ||
1058 | memset(&per_cpu(device_mce, cpu).kobj, 0, sizeof(struct kobject)); | 1058 | memset(&per_cpu(mce_dev, cpu).kobj, 0, sizeof(struct kobject)); |
1059 | per_cpu(device_mce, cpu).id = cpu; | 1059 | per_cpu(mce_dev, cpu).id = cpu; |
1060 | per_cpu(device_mce, cpu).cls = &mce_sysclass; | 1060 | per_cpu(mce_dev, cpu).cls = &mce_sysclass; |
1061 | 1061 | ||
1062 | err = sysdev_register(&per_cpu(device_mce, cpu)); | 1062 | err = sysdev_register(&per_cpu(mce_dev, cpu)); |
1063 | if (err) | 1063 | if (err) |
1064 | return err; | 1064 | return err; |
1065 | 1065 | ||
1066 | for (i = 0; mce_attributes[i]; i++) { | 1066 | for (i = 0; mce_attrs[i]; i++) { |
1067 | err = sysdev_create_file(&per_cpu(device_mce, cpu), | 1067 | err = sysdev_create_file(&per_cpu(mce_dev, cpu), mce_attrs[i]); |
1068 | mce_attributes[i]); | ||
1069 | if (err) | 1068 | if (err) |
1070 | goto error; | 1069 | goto error; |
1071 | } | 1070 | } |
1072 | for (i = 0; i < banks; i++) { | 1071 | for (i = 0; i < banks; i++) { |
1073 | err = sysdev_create_file(&per_cpu(device_mce, cpu), | 1072 | err = sysdev_create_file(&per_cpu(mce_dev, cpu), |
1074 | &bank_attrs[i]); | 1073 | &bank_attrs[i]); |
1075 | if (err) | 1074 | if (err) |
1076 | goto error2; | 1075 | goto error2; |
1077 | } | 1076 | } |
1078 | cpumask_set_cpu(cpu, mce_device_initialized); | 1077 | cpumask_set_cpu(cpu, mce_dev_initialized); |
1079 | 1078 | ||
1080 | return 0; | 1079 | return 0; |
1081 | error2: | 1080 | error2: |
1082 | while (--i >= 0) { | 1081 | while (--i >= 0) |
1083 | sysdev_remove_file(&per_cpu(device_mce, cpu), | 1082 | sysdev_remove_file(&per_cpu(mce_dev, cpu), &bank_attrs[i]); |
1084 | &bank_attrs[i]); | ||
1085 | } | ||
1086 | error: | 1083 | error: |
1087 | while (--i >= 0) { | 1084 | while (--i >= 0) |
1088 | sysdev_remove_file(&per_cpu(device_mce, cpu), | 1085 | sysdev_remove_file(&per_cpu(mce_dev, cpu), mce_attrs[i]); |
1089 | mce_attributes[i]); | 1086 | |
1090 | } | 1087 | sysdev_unregister(&per_cpu(mce_dev, cpu)); |
1091 | sysdev_unregister(&per_cpu(device_mce, cpu)); | ||
1092 | 1088 | ||
1093 | return err; | 1089 | return err; |
1094 | } | 1090 | } |
@@ -1097,24 +1093,24 @@ static __cpuinit void mce_remove_device(unsigned int cpu) | |||
1097 | { | 1093 | { |
1098 | int i; | 1094 | int i; |
1099 | 1095 | ||
1100 | if (!cpumask_test_cpu(cpu, mce_device_initialized)) | 1096 | if (!cpumask_test_cpu(cpu, mce_dev_initialized)) |
1101 | return; | 1097 | return; |
1102 | 1098 | ||
1103 | for (i = 0; mce_attributes[i]; i++) | 1099 | for (i = 0; mce_attrs[i]; i++) |
1104 | sysdev_remove_file(&per_cpu(device_mce, cpu), | 1100 | sysdev_remove_file(&per_cpu(mce_dev, cpu), mce_attrs[i]); |
1105 | mce_attributes[i]); | 1101 | |
1106 | for (i = 0; i < banks; i++) | 1102 | for (i = 0; i < banks; i++) |
1107 | sysdev_remove_file(&per_cpu(device_mce, cpu), | 1103 | sysdev_remove_file(&per_cpu(mce_dev, cpu), &bank_attrs[i]); |
1108 | &bank_attrs[i]); | 1104 | |
1109 | sysdev_unregister(&per_cpu(device_mce, cpu)); | 1105 | sysdev_unregister(&per_cpu(mce_dev, cpu)); |
1110 | cpumask_clear_cpu(cpu, mce_device_initialized); | 1106 | cpumask_clear_cpu(cpu, mce_dev_initialized); |
1111 | } | 1107 | } |
1112 | 1108 | ||
1113 | /* Make sure there are no machine checks on offlined CPUs. */ | 1109 | /* Make sure there are no machine checks on offlined CPUs. */ |
1114 | static void mce_disable_cpu(void *h) | 1110 | static void mce_disable_cpu(void *h) |
1115 | { | 1111 | { |
1116 | int i; | ||
1117 | unsigned long action = *(unsigned long *)h; | 1112 | unsigned long action = *(unsigned long *)h; |
1113 | int i; | ||
1118 | 1114 | ||
1119 | if (!mce_available(¤t_cpu_data)) | 1115 | if (!mce_available(¤t_cpu_data)) |
1120 | return; | 1116 | return; |
@@ -1221,7 +1217,7 @@ static __init int mce_init_device(void) | |||
1221 | if (!mce_available(&boot_cpu_data)) | 1217 | if (!mce_available(&boot_cpu_data)) |
1222 | return -EIO; | 1218 | return -EIO; |
1223 | 1219 | ||
1224 | alloc_cpumask_var(&mce_device_initialized, GFP_KERNEL); | 1220 | alloc_cpumask_var(&mce_dev_initialized, GFP_KERNEL); |
1225 | 1221 | ||
1226 | err = mce_init_banks(); | 1222 | err = mce_init_banks(); |
1227 | if (err) | 1223 | if (err) |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c index 4d90ec3eb51d..083f270251fa 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c | |||
@@ -517,7 +517,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) | |||
517 | if (!b) | 517 | if (!b) |
518 | goto out; | 518 | goto out; |
519 | 519 | ||
520 | err = sysfs_create_link(&per_cpu(device_mce, cpu).kobj, | 520 | err = sysfs_create_link(&per_cpu(mce_dev, cpu).kobj, |
521 | b->kobj, name); | 521 | b->kobj, name); |
522 | if (err) | 522 | if (err) |
523 | goto out; | 523 | goto out; |
@@ -540,7 +540,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) | |||
540 | goto out; | 540 | goto out; |
541 | } | 541 | } |
542 | 542 | ||
543 | b->kobj = kobject_create_and_add(name, &per_cpu(device_mce, cpu).kobj); | 543 | b->kobj = kobject_create_and_add(name, &per_cpu(mce_dev, cpu).kobj); |
544 | if (!b->kobj) | 544 | if (!b->kobj) |
545 | goto out_free; | 545 | goto out_free; |
546 | 546 | ||
@@ -560,7 +560,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) | |||
560 | if (i == cpu) | 560 | if (i == cpu) |
561 | continue; | 561 | continue; |
562 | 562 | ||
563 | err = sysfs_create_link(&per_cpu(device_mce, i).kobj, | 563 | err = sysfs_create_link(&per_cpu(mce_dev, i).kobj, |
564 | b->kobj, name); | 564 | b->kobj, name); |
565 | if (err) | 565 | if (err) |
566 | goto out; | 566 | goto out; |
@@ -638,7 +638,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank) | |||
638 | #ifdef CONFIG_SMP | 638 | #ifdef CONFIG_SMP |
639 | /* sibling symlink */ | 639 | /* sibling symlink */ |
640 | if (shared_bank[bank] && b->blocks->cpu != cpu) { | 640 | if (shared_bank[bank] && b->blocks->cpu != cpu) { |
641 | sysfs_remove_link(&per_cpu(device_mce, cpu).kobj, name); | 641 | sysfs_remove_link(&per_cpu(mce_dev, cpu).kobj, name); |
642 | per_cpu(threshold_banks, cpu)[bank] = NULL; | 642 | per_cpu(threshold_banks, cpu)[bank] = NULL; |
643 | 643 | ||
644 | return; | 644 | return; |
@@ -650,7 +650,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank) | |||
650 | if (i == cpu) | 650 | if (i == cpu) |
651 | continue; | 651 | continue; |
652 | 652 | ||
653 | sysfs_remove_link(&per_cpu(device_mce, i).kobj, name); | 653 | sysfs_remove_link(&per_cpu(mce_dev, i).kobj, name); |
654 | per_cpu(threshold_banks, i)[bank] = NULL; | 654 | per_cpu(threshold_banks, i)[bank] = NULL; |
655 | } | 655 | } |
656 | 656 | ||