staging: dgnc: fix whitespace before return
authorTobin C. Harding <me@tobin.cc>
Mon, 13 Mar 2017 01:37:33 +0000 (12:37 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Mar 2017 22:27:31 +0000 (06:27 +0800)
Checkpatch emits CHECK: Blank lines aren't necessary before a close
brace '}'. Previous attempts were made to make uniform the error
handling in dgnc but improvements are still possible.

Undo whitespace changes that should not have been made :(. Make return
statement placement uniform throughout dgnc. Fix checkpatch
CHECK. Make whitespace changes only.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_driver.c
drivers/staging/dgnc/dgnc_mgmt.c
drivers/staging/dgnc/dgnc_tty.c

index e970d2dbf659331ed434e46bd2204f194ce6079d..0fd6f77dd04f40ede9f4dab735c37e82c2885962 100644 (file)
@@ -280,6 +280,7 @@ static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id)
 
 failed:
        kfree(brd);
+
        return ERR_PTR(rc);
 }
 
@@ -411,6 +412,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        brd->dpastatus = BD_RUNNING;
 
        dgnc_board[dgnc_num_boards++] = brd;
+
        return 0;
 
 free_irq:
@@ -419,6 +421,7 @@ unregister_tty:
        dgnc_tty_unregister(brd);
 failed:
        kfree(brd);
+
        return rc;
 }
 
@@ -477,12 +480,14 @@ static int dgnc_start(void)
        spin_unlock_irqrestore(&dgnc_poll_lock, flags);
 
        add_timer(&dgnc_poll_timer);
+
        return 0;
 
 failed_device:
        class_destroy(dgnc_class);
 failed_class:
        unregister_chrdev(dgnc_major, "dgnc");
+
        return rc;
 }
 
@@ -596,7 +601,6 @@ static int __init dgnc_init_module(void)
                cleanup();
                return rc;
        }
-
        return 0;
 }
 
index 9e984ebea8f96b8a66c9a2cc2e7eb11726c331ab..ee8a626ee31ce5cf96831274c2d334ba4299fdb4 100644 (file)
@@ -60,6 +60,7 @@ int dgnc_mgmt_open(struct inode *inode, struct file *file)
 
 out:
        spin_unlock_irqrestore(&dgnc_global_lock, flags);
+
        return rc;
 }
 
@@ -85,6 +86,7 @@ int dgnc_mgmt_close(struct inode *inode, struct file *file)
 
 out:
        spin_unlock_irqrestore(&dgnc_global_lock, flags);
+
        return rc;
 }
 
@@ -253,6 +255,5 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                break;
        }
        }
-
        return 0;
 }
index cbf90e0e91e7da07011f92b11fc104288ec1d60d..c58eaa9f9a7908aadab6871af7e4e60181cdbc3d 100644 (file)
@@ -218,6 +218,7 @@ unregister_serial_driver:
        tty_unregister_driver(brd->serial_driver);
 free_serial_driver:
        put_tty_driver(brd->serial_driver);
+
        return rc;
 }
 
@@ -319,6 +320,7 @@ err_free_channels:
                kfree(brd->channels[i]);
                brd->channels[i] = NULL;
        }
+
        return rc;
 }
 
@@ -1081,11 +1083,12 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
 
 err_brd_unlock:
        spin_unlock_irqrestore(&brd->bd_lock, flags);
+
        return rc;
 err_ch_unlock:
        spin_unlock_irqrestore(&ch->ch_lock, flags);
-       return rc;
 
+       return rc;
 }
 
 /*
@@ -1212,6 +1215,7 @@ static int dgnc_block_til_ready(struct tty_struct *tty,
        ch->ch_wopen--;
 
        spin_unlock_irqrestore(&ch->ch_lock, flags);
+
        return rc;
 }
 
@@ -1660,6 +1664,7 @@ static int dgnc_tty_write(struct tty_struct *tty,
 
 exit_retry:
        spin_unlock_irqrestore(&ch->ch_lock, flags);
+
        return 0;
 }
 
@@ -2400,7 +2405,6 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
                        return -ENODEV;
 
                rc = ch_bd_ops->drain(tty, 0);
-
                if (rc)
                        return -EINTR;
 
@@ -2787,5 +2791,6 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
        }
 err_unlock:
        spin_unlock_irqrestore(&ch->ch_lock, flags);
+
        return rc;
 }