x86: coding style fixes to arch/x86/kernel/vm86_32.c
Before: total: 64 errors, 18 warnings, 840 lines checked After: total: 12 errors, 15 warnings, 844 lines checked No code changed: arch/x86/kernel/vm86_32.o: text data bss dec hex filename 4449 28 132 4609 1201 vm86_32.o.before 4449 28 132 4609 1201 vm86_32.o.after md5: e4e51ed7689d17f04148554a3c6d5bb6 vm86_32.o.before.asm e4e51ed7689d17f04148554a3c6d5bb6 vm86_32.o.after.asm Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
fb87a298fb
commit
83e714e82f
1 changed files with 89 additions and 85 deletions
|
@ -93,8 +93,10 @@ static int copy_vm86_regs_to_user(struct vm86_regs __user *user,
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/* kernel_vm86_regs is missing gs, so copy everything up to
|
/*
|
||||||
(but not including) orig_eax, and then rest including orig_eax. */
|
* kernel_vm86_regs is missing gs, so copy everything up to
|
||||||
|
* (but not including) orig_eax, and then rest including orig_eax.
|
||||||
|
*/
|
||||||
ret += copy_to_user(user, regs, offsetof(struct kernel_vm86_regs, pt.orig_ax));
|
ret += copy_to_user(user, regs, offsetof(struct kernel_vm86_regs, pt.orig_ax));
|
||||||
ret += copy_to_user(&user->orig_eax, ®s->pt.orig_ax,
|
ret += copy_to_user(&user->orig_eax, ®s->pt.orig_ax,
|
||||||
sizeof(struct kernel_vm86_regs) -
|
sizeof(struct kernel_vm86_regs) -
|
||||||
|
@ -244,10 +246,11 @@ asmlinkage int sys_vm86(struct pt_regs regs)
|
||||||
ret = do_vm86_irq_handling(regs.bx, (int)regs.cx);
|
ret = do_vm86_irq_handling(regs.bx, (int)regs.cx);
|
||||||
goto out;
|
goto out;
|
||||||
case VM86_PLUS_INSTALL_CHECK:
|
case VM86_PLUS_INSTALL_CHECK:
|
||||||
/* NOTE: on old vm86 stuff this will return the error
|
/*
|
||||||
from access_ok(), because the subfunction is
|
* NOTE: on old vm86 stuff this will return the error
|
||||||
interpreted as (invalid) address to vm86_struct.
|
* from access_ok(), because the subfunction is
|
||||||
So the installation check works.
|
* interpreted as (invalid) address to vm86_struct.
|
||||||
|
* So the installation check works.
|
||||||
*/
|
*/
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -380,7 +383,8 @@ static inline void clear_AC(struct kernel_vm86_regs * regs)
|
||||||
regs->pt.flags &= ~AC_MASK;
|
regs->pt.flags &= ~AC_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* It is correct to call set_IF(regs) from the set_vflags_*
|
/*
|
||||||
|
* It is correct to call set_IF(regs) from the set_vflags_*
|
||||||
* functions. However someone forgot to call clear_IF(regs)
|
* functions. However someone forgot to call clear_IF(regs)
|
||||||
* in the opposite case.
|
* in the opposite case.
|
||||||
* After the command sequence CLI PUSHF STI POPF you should
|
* After the command sequence CLI PUSHF STI POPF you should
|
||||||
|
@ -636,11 +640,11 @@ void handle_vm86_fault(struct kernel_vm86_regs * regs, long error_code)
|
||||||
}
|
}
|
||||||
IP(regs) = ip;
|
IP(regs) = ip;
|
||||||
CHECK_IF_IN_TRAP;
|
CHECK_IF_IN_TRAP;
|
||||||
if (data32) {
|
if (data32)
|
||||||
set_vflags_long(newflags, regs);
|
set_vflags_long(newflags, regs);
|
||||||
} else {
|
else
|
||||||
set_vflags_short(newflags, regs);
|
set_vflags_short(newflags, regs);
|
||||||
}
|
|
||||||
VM86_FAULT_RETURN;
|
VM86_FAULT_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue