oprofile, x86: Simplify init/exit functions
Now, that we only call the exit function if init succeeds with commit:
979048e
oprofile: don't call arch exit code from init code on failure
we can simplify the x86 init/exit functions too. Variable using_nmi
becomes obsolete.
Signed-off-by: Robert Richter <robert.richter@amd.com>
This commit is contained in:
Родитель
f6dedecc37
Коммит
5140434d5f
|
@ -695,9 +695,6 @@ static int __init ppro_init(char **cpu_type)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* in order to get sysfs right */
|
|
||||||
static int using_nmi;
|
|
||||||
|
|
||||||
int __init op_nmi_init(struct oprofile_operations *ops)
|
int __init op_nmi_init(struct oprofile_operations *ops)
|
||||||
{
|
{
|
||||||
__u8 vendor = boot_cpu_data.x86_vendor;
|
__u8 vendor = boot_cpu_data.x86_vendor;
|
||||||
|
@ -705,8 +702,6 @@ int __init op_nmi_init(struct oprofile_operations *ops)
|
||||||
char *cpu_type = NULL;
|
char *cpu_type = NULL;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
using_nmi = 0;
|
|
||||||
|
|
||||||
if (!cpu_has_apic)
|
if (!cpu_has_apic)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
|
@ -790,13 +785,11 @@ int __init op_nmi_init(struct oprofile_operations *ops)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
using_nmi = 1;
|
|
||||||
printk(KERN_INFO "oprofile: using NMI interrupt.\n");
|
printk(KERN_INFO "oprofile: using NMI interrupt.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void op_nmi_exit(void)
|
void op_nmi_exit(void)
|
||||||
{
|
{
|
||||||
if (using_nmi)
|
exit_sysfs();
|
||||||
exit_sysfs();
|
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче