Skip to contentSkip to conversation

x86/microcode: Use nonseekable_open

PATCH In review Frederic Weisbecker 2 participants 2 messages Apr 10, 2010 – Apr 14, 2010 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/microcode: Use nonseekable_open

From: Arnd Bergmann <[email protected]>

No need to seek on this file, so prevent it outright so we can avoid using default_llseek.

Cc Ingo Molnar <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Thomas Gleixner <[email protected]>
[drop useless llseek = no_llseek and smp_lock.h inclusion]
---
 arch/x86/kernel/microcode_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/microcode_core.c +2 -2
index cceb5bc..2cd8c54 100644
@@ -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,
Signature · 1 line
1.6.2.3
#1 lore raw

[tip:x86/microcode] x86/microcode: Use nonseekable_open()

Commit-ID:  3f10940e4fb69d312602078f2c5234206797ca31
Gitweb:     http://git.kernel.org/tip/3f10940e4fb69d312602078f2c5234206797ca31
Author:     Arnd Bergmann <[email protected]>
AuthorDate: Sat, 10 Apr 2010 16:46:21 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 14 Apr 2010 12:27:34 +0200

x86/microcode: Use nonseekable_open()

No need to seek on this file, so prevent it outright so we can avoid using default_llseek - removes one more BKL usage.

[drop useless llseek = no_llseek and smp_lock.h inclusion]
Cc Arnd Bergmann <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Dmitry Adamushko <[email protected]>

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/microcode_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/microcode_core.c +2 -2
index cceb5bc..2cd8c54 100644
@@ -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,