From: Shane Warden Date: Tue, 22 Sep 2009 23:13:02 +0000 (-0700) Subject: Staging: comedi: comedi_compat32: Fixed checkpatch.pl issues X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f36624369ff2922f3aa8b5cef0376bcec759ebef;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Staging: comedi: comedi_compat32: Fixed checkpatch.pl issues Signed-off-by: Shane Warden Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/comedi_compat32.c b/drivers/staging/comedi/comedi_compat32.c index 9810e37845c7..e2d7e6975263 100644 --- a/drivers/staging/comedi/comedi_compat32.c +++ b/drivers/staging/comedi/comedi_compat32.c @@ -27,7 +27,7 @@ #define __NO_VERSION__ #include "comedi.h" #include -#include +#include #include "comedi_compat32.h" @@ -186,8 +186,8 @@ static int compat_rangeinfo(struct file *file, unsigned long arg) } /* Copy 32-bit cmd structure to native cmd structure. */ -static int get_compat_cmd(struct comedi_cmd __user * cmd, - struct comedi32_cmd_struct __user * cmd32) +static int get_compat_cmd(struct comedi_cmd __user *cmd, + struct comedi32_cmd_struct __user *cmd32) { int err; union { @@ -237,8 +237,8 @@ static int get_compat_cmd(struct comedi_cmd __user * cmd, } /* Copy native cmd structure to 32-bit cmd structure. */ -static int put_compat_cmd(struct comedi32_cmd_struct __user * cmd32, - struct comedi_cmd __user * cmd) +static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32, + struct comedi_cmd __user *cmd) { int err; unsigned int temp; @@ -328,8 +328,8 @@ static int compat_cmdtest(struct file *file, unsigned long arg) } /* Copy 32-bit insn structure to native insn structure. */ -static int get_compat_insn(struct comedi_insn __user * insn, - struct comedi32_insn_struct __user * insn32) +static int get_compat_insn(struct comedi_insn __user *insn, + struct comedi32_insn_struct __user *insn32) { int err; union { @@ -372,9 +372,9 @@ static int compat_insnlist(struct file *file, unsigned long arg) insnlist32 = compat_ptr(arg); /* Get 32-bit insnlist structure. */ - if (!access_ok(VERIFY_READ, insnlist32, sizeof(*insnlist32))) { + if (!access_ok(VERIFY_READ, insnlist32, sizeof(*insnlist32))) return -EFAULT; - } + err = 0; err |= __get_user(n_insns, &insnlist32->n_insns); err |= __get_user(uptr, &insnlist32->insns); @@ -387,9 +387,9 @@ static int compat_insnlist(struct file *file, unsigned long arg) insn[n_insns])); /* Set native insnlist structure. */ - if (!access_ok(VERIFY_WRITE, &s->insnlist, sizeof(s->insnlist))) { + if (!access_ok(VERIFY_WRITE, &s->insnlist, sizeof(s->insnlist))) return -EFAULT; - } + err |= __put_user(n_insns, &s->insnlist.n_insns); err |= __put_user(&s->insn[0], &s->insnlist.insns); if (err)