From 7261fb9bcb40251e4d3153f30624bffe1bba914d Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 13 Mar 2017 12:37:33 +1100 Subject: [PATCH] staging: dgnc: fix whitespace before return 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 6 +++++- drivers/staging/dgnc/dgnc_mgmt.c | 3 ++- drivers/staging/dgnc/dgnc_tty.c | 9 +++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index e970d2dbf659..0fd6f77dd04f 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -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; } diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c index 9e984ebea8f9..ee8a626ee31c 100644 --- a/drivers/staging/dgnc/dgnc_mgmt.c +++ b/drivers/staging/dgnc/dgnc_mgmt.c @@ -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; } diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index cbf90e0e91e7..c58eaa9f9a79 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -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; } -- 2.30.2