[patch] x86/iopl: Remove unused local variable, update comments in ksys_ioperm()
From: Ingo Molnar
Date: Thu Nov 07 2019 - 02:28:55 EST
* Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> The series is also available from git:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/iopl
Very nice series - I fully agree with this simplification of ioperm
legacies.
On x86-64 defconfig new warning in ioport.c:
arch/x86/kernel/ioport.c:184:18: warning: unused variable âregsâ [-Wunused-variable]
This local variable can simply be removed, now that we don't rely on
regs->flags anymore. See the patch below.
I also removed the now stale comment about the Xen PV
quirk/incompatibility.
Thanks,
Ingo
---
arch/x86/kernel/ioport.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c
index aad296a23170..78127087b1ed 100644
--- a/arch/x86/kernel/ioport.c
+++ b/arch/x86/kernel/ioport.c
@@ -181,15 +181,10 @@ SYSCALL_DEFINE3(ioperm, unsigned long, from, unsigned long, num, int, turn_on)
SYSCALL_DEFINE1(iopl, unsigned int, level)
{
struct thread_struct *t = ¤t->thread;
- struct pt_regs *regs = current_pt_regs();
struct tss_struct *tss;
unsigned int tss_base;
unsigned int old;
- /*
- * Careful: the IOPL bits in regs->flags are undefined under Xen PV
- * and changing them has no effect.
- */
if (IS_ENABLED(CONFIG_X86_IOPL_NONE))
return -ENOSYS;