[PATCH 2/3] staging: dgnc: fix whitespace before return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
 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 e970d2d..0fd6f77 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 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	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 9e984eb..ee8a626 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 cbf90e0..c58eaa9 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -218,6 +218,7 @@ int dgnc_tty_register(struct dgnc_board *brd)
 	tty_unregister_driver(brd->serial_driver);
 free_serial_driver:
 	put_tty_driver(brd->serial_driver);
+
 	return rc;
 }
 
@@ -319,6 +320,7 @@ int dgnc_tty_init(struct dgnc_board *brd)
 		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.7.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux