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 /arch/x86/kernel/cpu/mcheck/mce.c | |
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>
Diffstat (limited to 'arch/x86/kernel/cpu/mcheck/mce.c')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 58 |
1 files changed, 27 insertions, 31 deletions
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) |