Skip to content

Commit

Permalink
x86, cpuid: Remove the bkl from cpuid_open()
Browse files Browse the repository at this point in the history
Most of the variables are local to the function. It IS possible that
for struct cpuinfo_x86 *c c could point to the same area. However,
this is used read only.

Signed-off-by: John Kacur <jkacur@redhat.com>
LKML-Reference: <alpine.LFD.2.00.0910072016190.15183@localhost.localdomain>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
John Kacur authored and H. Peter Anvin committed Oct 7, 2009
1 parent d6c3040 commit 170a0bc
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions arch/x86/kernel/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ static int cpuid_open(struct inode *inode, struct file *file)
struct cpuinfo_x86 *c;
int ret = 0;

lock_kernel();

cpu = iminor(file->f_path.dentry->d_inode);
if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
ret = -ENXIO; /* No such CPU */
Expand All @@ -129,7 +127,6 @@ static int cpuid_open(struct inode *inode, struct file *file)
if (c->cpuid_level < 0)
ret = -EIO; /* CPUID not supported */
out:
unlock_kernel();
return ret;
}

Expand Down

0 comments on commit 170a0bc

Please sign in to comment.