Skip to content

Commit

Permalink
oprofile, x86: Simplify init/exit functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Richter committed Oct 1, 2010
1 parent f6dedec commit 5140434
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions arch/x86/oprofile/nmi_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,18 +695,13 @@ static int __init ppro_init(char **cpu_type)
return 1;
}

/* in order to get sysfs right */
static int using_nmi;

int __init op_nmi_init(struct oprofile_operations *ops)
{
__u8 vendor = boot_cpu_data.x86_vendor;
__u8 family = boot_cpu_data.x86;
char *cpu_type = NULL;
int ret = 0;

using_nmi = 0;

if (!cpu_has_apic)
return -ENODEV;

Expand Down Expand Up @@ -790,13 +785,11 @@ int __init op_nmi_init(struct oprofile_operations *ops)
if (ret)
return ret;

using_nmi = 1;
printk(KERN_INFO "oprofile: using NMI interrupt.\n");
return 0;
}

void op_nmi_exit(void)
{
if (using_nmi)
exit_sysfs();
exit_sysfs();
}

0 comments on commit 5140434

Please sign in to comment.