[PATCH 2/2] staging: ft1000: remove assigments of ret and initialise it in beginning

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

 



as ret is every time assigned to EINVAL in fail cases, initialise it at
the beginning.

Signed-off-by: Devendra Naga <devendra.aaru@xxxxxxxxx>
---
 drivers/staging/ft1000/ft1000-usb/ft1000_proc.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c b/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
index b282cd6..1258a32 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
@@ -205,7 +205,7 @@ int ft1000_init_proc(struct net_device *dev)
 {
 	struct ft1000_info *info;
 	struct proc_dir_entry *ft1000_proc_file;
-	int ret = 0;
+	int ret = -EINVAL;
 
 	info = netdev_priv(dev);
 
@@ -213,7 +213,6 @@ int ft1000_init_proc(struct net_device *dev)
 	if (info->ft1000_proc_dir == NULL) {
 		printk(KERN_WARNING "Unable to create %s dir.\n",
 			FT1000_PROC_DIR);
-		ret = -EINVAL;
 		goto fail;
 	}
 
@@ -223,7 +222,6 @@ int ft1000_init_proc(struct net_device *dev)
 
 	if (ft1000_proc_file == NULL) {
 		printk(KERN_WARNING "Unable to create /proc entry.\n");
-		ret = -EINVAL;
 		goto fail_entry;
 	}
 
-- 
1.7.10.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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