[OPW,kernel] staging: dgnc: fixed checkpatch warnings regarding if/else statements
diff mbox

Message ID 20131104213004.GA30984@dev
State Awaiting Upstream
Headers show

Commit Message

C. Koppelt Nov. 4, 2013, 9:30 p.m. UTC
this patch fixes checkpatch warnings regarding unnecessary braces or
braces on the wrong place

Signed-off-by: Christine Koppelt <opw.chk@gmail.com>
---
 drivers/staging/dgnc/dgnc_mgmt.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

Lisa Nguyen Nov. 4, 2013, 11:34 p.m. UTC | #1
On Mon, Nov 4, 2013 at 1:30 PM, Christine Koppelt <opw.chk@gmail.com> wrote:
> this patch fixes checkpatch warnings regarding unnecessary braces or
> braces on the wrong place
>
> Signed-off-by: Christine Koppelt <opw.chk@gmail.com>

Looks good.

Reviewed-by: Lisa Nguyen <lisa@xenapiadmin.com>

> ---
>  drivers/staging/dgnc/dgnc_mgmt.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
> index 1c5ab3d..47222a0 100644
> --- a/drivers/staging/dgnc/dgnc_mgmt.c
> +++ b/drivers/staging/dgnc/dgnc_mgmt.c
> @@ -77,8 +77,7 @@ int dgnc_mgmt_open(struct inode *inode, struct file *file)
>                         return -EBUSY;
>                 }
>                 dgnc_mgmt_in_use[minor]++;
> -       }
> -       else {
> +       } else {
>                 DGNC_UNLOCK(dgnc_global_lock, lock_flags);
>                 return -ENXIO;
>         }
> @@ -107,9 +106,8 @@ int dgnc_mgmt_close(struct inode *inode, struct file *file)
>
>         /* mgmt device */
>         if (minor < MAXMGMTDEVICES) {
> -               if (dgnc_mgmt_in_use[minor]) {
> +               if (dgnc_mgmt_in_use[minor])
>                         dgnc_mgmt_in_use[minor] = 0;
> -               }
>         }
>         DGNC_UNLOCK(dgnc_global_lock, lock_flags);
>
> @@ -165,9 +163,8 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>
>                 struct digi_info di;
>
> -               if (copy_from_user(&brd, uarg, sizeof(int))) {
> +               if (copy_from_user(&brd, uarg, sizeof(int)))
>                         return -EFAULT;
> -               }
>
>                 DPR_MGMT(("DIGI_GETBD asking about board: %d\n", brd));
>
> @@ -209,9 +206,8 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>                 uint board = 0;
>                 uint channel = 0;
>
> -               if (copy_from_user(&ni, uarg, sizeof(ni))) {
> +               if (copy_from_user(&ni, uarg, sizeof(ni)))
>                         return -EFAULT;
> -               }
>
>                 DPR_MGMT(("DIGI_GETBD asking about board: %d channel: %d\n",
>                         ni.board, ni.channel));
> --
> 1.8.4.rc3
>
> --
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Greg KH Nov. 10, 2013, 8:18 p.m. UTC | #2
On Mon, Nov 04, 2013 at 10:30:04PM +0100, Christine Koppelt wrote:
> this patch fixes checkpatch warnings regarding unnecessary braces or
> braces on the wrong place
> 
> Signed-off-by: Christine Koppelt <opw.chk@gmail.com>

Please always run your patches through checkpatch.pl so as to not add
new warnings in your patch.  Because of this, I can't accept this patch,
sorry.

greg k-h

Patch
diff mbox

diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
index 1c5ab3d..47222a0 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.c
+++ b/drivers/staging/dgnc/dgnc_mgmt.c
@@ -77,8 +77,7 @@  int dgnc_mgmt_open(struct inode *inode, struct file *file)
 			return -EBUSY;
 		}
 		dgnc_mgmt_in_use[minor]++;
-	}
-	else {
+	} else {
 		DGNC_UNLOCK(dgnc_global_lock, lock_flags);
 		return -ENXIO;
 	}
@@ -107,9 +106,8 @@  int dgnc_mgmt_close(struct inode *inode, struct file *file)
 
 	/* mgmt device */
 	if (minor < MAXMGMTDEVICES) {
-		if (dgnc_mgmt_in_use[minor]) {
+		if (dgnc_mgmt_in_use[minor]) 
 			dgnc_mgmt_in_use[minor] = 0;
-		}
 	}
 	DGNC_UNLOCK(dgnc_global_lock, lock_flags);
 
@@ -165,9 +163,8 @@  long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
 		struct digi_info di;
 
-		if (copy_from_user(&brd, uarg, sizeof(int))) {
+		if (copy_from_user(&brd, uarg, sizeof(int)))
 			return -EFAULT;
-		}
 
 		DPR_MGMT(("DIGI_GETBD asking about board: %d\n", brd));
 
@@ -209,9 +206,8 @@  long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		uint board = 0;
 		uint channel = 0;
 
-		if (copy_from_user(&ni, uarg, sizeof(ni))) {
+		if (copy_from_user(&ni, uarg, sizeof(ni)))
 			return -EFAULT;
-		}
 
 		DPR_MGMT(("DIGI_GETBD asking about board: %d channel: %d\n",
 			ni.board, ni.channel));