staging: ft1000: remove assigments of ret and initialise it in beginning
authorDevendra Naga <devendra.aaru@gmail.com>
Sat, 24 Nov 2012 10:01:06 +0000 (05:01 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Nov 2012 00:21:18 +0000 (16:21 -0800)
as ret is every time assigned to EINVAL in fail cases, initialise it at
the beginning.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ft1000/ft1000-usb/ft1000_proc.c

index 5ae396716136ea7d6146e2eda0118b9378d684a9..1edaddba816f3277d23ea7b21f7b6523611b9b7e 100644 (file)
@@ -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;
        }