diff options
author | John Kacur <jkacur@redhat.com> | 2009-10-08 11:20:15 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-10-08 19:14:02 -0400 |
commit | 5a943617ef52e9f79cd7cf437aad8870be27aabb (patch) | |
tree | 967a0145cb287468c8c36c5f3d227cabb30a3e6e /arch/x86 | |
parent | 170a0bc3808909d8ea0f3f9c725c6565efe7f9c4 (diff) |
x86, cpuid: Simplify the code in cpuid_open
Peter picked up my patch for tip/x86/cpu that removes the bkl in
cpuid_open. Ingo subsequently merged that into tip/master.
This patch folds back in tglx's 55968ede164ae523692f00717f50cd926f1382a0
to my patch that removed the bkl.
This simplifies the code, and makes it consistent with the changes to
kill the bkl in msr.c as well.
Originally-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpuid.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index ef6928418c8f..48e8e6558b26 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c | |||
@@ -116,18 +116,16 @@ static int cpuid_open(struct inode *inode, struct file *file) | |||
116 | { | 116 | { |
117 | unsigned int cpu; | 117 | unsigned int cpu; |
118 | struct cpuinfo_x86 *c; | 118 | struct cpuinfo_x86 *c; |
119 | int ret = 0; | ||
120 | 119 | ||
121 | cpu = iminor(file->f_path.dentry->d_inode); | 120 | cpu = iminor(file->f_path.dentry->d_inode); |
122 | if (cpu >= nr_cpu_ids || !cpu_online(cpu)) { | 121 | if (cpu >= nr_cpu_ids || !cpu_online(cpu)) |
123 | ret = -ENXIO; /* No such CPU */ | 122 | return -ENXIO; /* No such CPU */ |
124 | goto out; | 123 | |
125 | } | ||
126 | c = &cpu_data(cpu); | 124 | c = &cpu_data(cpu); |
127 | if (c->cpuid_level < 0) | 125 | if (c->cpuid_level < 0) |
128 | ret = -EIO; /* CPUID not supported */ | 126 | return -EIO; /* CPUID not supported */ |
129 | out: | 127 | |
130 | return ret; | 128 | return 0; |
131 | } | 129 | } |
132 | 130 | ||
133 | /* | 131 | /* |