Skip to content

Commit

Permalink
x86/microcode: Use nonseekable_open()
Browse files Browse the repository at this point in the history
No need to seek on this file, so prevent it outright so we can
avoid using default_llseek - removes one more BKL usage.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[drop useless llseek = no_llseek and smp_lock.h inclusion]
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnd Bergmann <arnd@relay.de.ibm.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Dmitry Adamushko <dmitry.adamushko@gmail.com>
LKML-Reference: <1270910781-8786-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Arnd Bergmann authored and Ingo Molnar committed Apr 14, 2010
1 parent 938179b commit 3f10940
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kernel/microcode_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ static int do_microcode_update(const void __user *buf, size_t size)
return error;
}

static int microcode_open(struct inode *unused1, struct file *unused2)
static int microcode_open(struct inode *inode, struct file *file)
{
return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
return capable(CAP_SYS_RAWIO) ? nonseekable_open(inode, file) : -EPERM;
}

static ssize_t microcode_write(struct file *file, const char __user *buf,
Expand Down

0 comments on commit 3f10940

Please sign in to comment.