mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
dba3725d44
commit
cb491fca55
|
@ -90,7 +90,7 @@ extern int mce_disabled;
|
||||||
|
|
||||||
void mce_setup(struct mce *m);
|
void mce_setup(struct mce *m);
|
||||||
void mce_log(struct mce *m);
|
void mce_log(struct mce *m);
|
||||||
DECLARE_PER_CPU(struct sys_device, device_mce);
|
DECLARE_PER_CPU(struct sys_device, mce_dev);
|
||||||
extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
|
extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -957,7 +957,7 @@ static struct sysdev_class mce_sysclass = {
|
||||||
.name = "machinecheck",
|
.name = "machinecheck",
|
||||||
};
|
};
|
||||||
|
|
||||||
DEFINE_PER_CPU(struct sys_device, device_mce);
|
DEFINE_PER_CPU(struct sys_device, mce_dev);
|
||||||
|
|
||||||
__cpuinitdata
|
__cpuinitdata
|
||||||
void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
|
void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
|
||||||
|
@ -1039,12 +1039,12 @@ static SYSDEV_INT_ATTR(tolerant, 0644, tolerant);
|
||||||
|
|
||||||
ACCESSOR(check_interval, check_interval, mce_restart())
|
ACCESSOR(check_interval, check_interval, mce_restart())
|
||||||
|
|
||||||
static struct sysdev_attribute *mce_attributes[] = {
|
static struct sysdev_attribute *mce_attrs[] = {
|
||||||
&attr_tolerant.attr, &attr_check_interval, &attr_trigger,
|
&attr_tolerant.attr, &attr_check_interval, &attr_trigger,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static cpumask_var_t mce_device_initialized;
|
static cpumask_var_t mce_dev_initialized;
|
||||||
|
|
||||||
/* Per cpu sysdev init. All of the cpus still share the same ctrl bank: */
|
/* Per cpu sysdev init. All of the cpus still share the same ctrl bank: */
|
||||||
static __cpuinit int mce_create_device(unsigned int cpu)
|
static __cpuinit int mce_create_device(unsigned int cpu)
|
||||||
|
@ -1055,40 +1055,36 @@ static __cpuinit int mce_create_device(unsigned int cpu)
|
||||||
if (!mce_available(&boot_cpu_data))
|
if (!mce_available(&boot_cpu_data))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
memset(&per_cpu(device_mce, cpu).kobj, 0, sizeof(struct kobject));
|
memset(&per_cpu(mce_dev, cpu).kobj, 0, sizeof(struct kobject));
|
||||||
per_cpu(device_mce, cpu).id = cpu;
|
per_cpu(mce_dev, cpu).id = cpu;
|
||||||
per_cpu(device_mce, cpu).cls = &mce_sysclass;
|
per_cpu(mce_dev, cpu).cls = &mce_sysclass;
|
||||||
|
|
||||||
err = sysdev_register(&per_cpu(device_mce, cpu));
|
err = sysdev_register(&per_cpu(mce_dev, cpu));
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
for (i = 0; mce_attributes[i]; i++) {
|
for (i = 0; mce_attrs[i]; i++) {
|
||||||
err = sysdev_create_file(&per_cpu(device_mce, cpu),
|
err = sysdev_create_file(&per_cpu(mce_dev, cpu), mce_attrs[i]);
|
||||||
mce_attributes[i]);
|
|
||||||
if (err)
|
if (err)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
for (i = 0; i < banks; i++) {
|
for (i = 0; i < banks; i++) {
|
||||||
err = sysdev_create_file(&per_cpu(device_mce, cpu),
|
err = sysdev_create_file(&per_cpu(mce_dev, cpu),
|
||||||
&bank_attrs[i]);
|
&bank_attrs[i]);
|
||||||
if (err)
|
if (err)
|
||||||
goto error2;
|
goto error2;
|
||||||
}
|
}
|
||||||
cpumask_set_cpu(cpu, mce_device_initialized);
|
cpumask_set_cpu(cpu, mce_dev_initialized);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
error2:
|
error2:
|
||||||
while (--i >= 0) {
|
while (--i >= 0)
|
||||||
sysdev_remove_file(&per_cpu(device_mce, cpu),
|
sysdev_remove_file(&per_cpu(mce_dev, cpu), &bank_attrs[i]);
|
||||||
&bank_attrs[i]);
|
|
||||||
}
|
|
||||||
error:
|
error:
|
||||||
while (--i >= 0) {
|
while (--i >= 0)
|
||||||
sysdev_remove_file(&per_cpu(device_mce, cpu),
|
sysdev_remove_file(&per_cpu(mce_dev, cpu), mce_attrs[i]);
|
||||||
mce_attributes[i]);
|
|
||||||
}
|
sysdev_unregister(&per_cpu(mce_dev, cpu));
|
||||||
sysdev_unregister(&per_cpu(device_mce, cpu));
|
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -1097,24 +1093,24 @@ static __cpuinit void mce_remove_device(unsigned int cpu)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!cpumask_test_cpu(cpu, mce_device_initialized))
|
if (!cpumask_test_cpu(cpu, mce_dev_initialized))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; mce_attributes[i]; i++)
|
for (i = 0; mce_attrs[i]; i++)
|
||||||
sysdev_remove_file(&per_cpu(device_mce, cpu),
|
sysdev_remove_file(&per_cpu(mce_dev, cpu), mce_attrs[i]);
|
||||||
mce_attributes[i]);
|
|
||||||
for (i = 0; i < banks; i++)
|
for (i = 0; i < banks; i++)
|
||||||
sysdev_remove_file(&per_cpu(device_mce, cpu),
|
sysdev_remove_file(&per_cpu(mce_dev, cpu), &bank_attrs[i]);
|
||||||
&bank_attrs[i]);
|
|
||||||
sysdev_unregister(&per_cpu(device_mce, cpu));
|
sysdev_unregister(&per_cpu(mce_dev, cpu));
|
||||||
cpumask_clear_cpu(cpu, mce_device_initialized);
|
cpumask_clear_cpu(cpu, mce_dev_initialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure there are no machine checks on offlined CPUs. */
|
/* Make sure there are no machine checks on offlined CPUs. */
|
||||||
static void mce_disable_cpu(void *h)
|
static void mce_disable_cpu(void *h)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
unsigned long action = *(unsigned long *)h;
|
unsigned long action = *(unsigned long *)h;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (!mce_available(¤t_cpu_data))
|
if (!mce_available(¤t_cpu_data))
|
||||||
return;
|
return;
|
||||||
|
@ -1221,7 +1217,7 @@ static __init int mce_init_device(void)
|
||||||
if (!mce_available(&boot_cpu_data))
|
if (!mce_available(&boot_cpu_data))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
alloc_cpumask_var(&mce_device_initialized, GFP_KERNEL);
|
alloc_cpumask_var(&mce_dev_initialized, GFP_KERNEL);
|
||||||
|
|
||||||
err = mce_init_banks();
|
err = mce_init_banks();
|
||||||
if (err)
|
if (err)
|
||||||
|
|
|
@ -517,7 +517,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
|
||||||
if (!b)
|
if (!b)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
err = sysfs_create_link(&per_cpu(device_mce, cpu).kobj,
|
err = sysfs_create_link(&per_cpu(mce_dev, cpu).kobj,
|
||||||
b->kobj, name);
|
b->kobj, name);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -540,7 +540,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
b->kobj = kobject_create_and_add(name, &per_cpu(device_mce, cpu).kobj);
|
b->kobj = kobject_create_and_add(name, &per_cpu(mce_dev, cpu).kobj);
|
||||||
if (!b->kobj)
|
if (!b->kobj)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
||||||
|
@ -560,7 +560,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
|
||||||
if (i == cpu)
|
if (i == cpu)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
err = sysfs_create_link(&per_cpu(device_mce, i).kobj,
|
err = sysfs_create_link(&per_cpu(mce_dev, i).kobj,
|
||||||
b->kobj, name);
|
b->kobj, name);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -638,7 +638,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
/* sibling symlink */
|
/* sibling symlink */
|
||||||
if (shared_bank[bank] && b->blocks->cpu != cpu) {
|
if (shared_bank[bank] && b->blocks->cpu != cpu) {
|
||||||
sysfs_remove_link(&per_cpu(device_mce, cpu).kobj, name);
|
sysfs_remove_link(&per_cpu(mce_dev, cpu).kobj, name);
|
||||||
per_cpu(threshold_banks, cpu)[bank] = NULL;
|
per_cpu(threshold_banks, cpu)[bank] = NULL;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -650,7 +650,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
|
||||||
if (i == cpu)
|
if (i == cpu)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
sysfs_remove_link(&per_cpu(device_mce, i).kobj, name);
|
sysfs_remove_link(&per_cpu(mce_dev, i).kobj, name);
|
||||||
per_cpu(threshold_banks, i)[bank] = NULL;
|
per_cpu(threshold_banks, i)[bank] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue