mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/microcode: Use nonseekable_open
@ 2010-04-10 14:46 Frederic Weisbecker
  2010-04-14 15:01 ` [tip:x86/microcode] x86/microcode: Use nonseekable_open() tip-bot for Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Frederic Weisbecker @ 2010-04-10 14:46 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Arnd Bergmann, Arnd Bergmann, H . Peter Anvin,
	Thomas Gleixner, Ingo Molnar, Frederic Weisbecker

From: Arnd Bergmann <arnd@relay.de.ibm.com>

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

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
[drop useless llseek = no_llseek and smp_lock.h inclusion]
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 arch/x86/kernel/microcode_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index cceb5bc..2cd8c54 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -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,
-- 
1.6.2.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-14 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-10 14:46 [PATCH] x86/microcode: Use nonseekable_open Frederic Weisbecker
2010-04-14 15:01 ` [tip:x86/microcode] x86/microcode: Use nonseekable_open() tip-bot for Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome