staging: remove unnecessary code
authorGreg Dietsche <Gregory.Dietsche@cuw.edu>
Mon, 13 Jun 2011 18:11:47 +0000 (13:11 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 28 Jun 2011 20:13:42 +0000 (13:13 -0700)
Compile tested.
remove unnecessary code that matches this coccinelle pattern
if (...)
return ret;
return ret;

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Acked-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/bcm/Misc.c
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
drivers/staging/comedi/comedi_fops.c
drivers/staging/comedi/drivers/usbdux.c
drivers/staging/tm6000/tm6000-cards.c

index c5003b62234c87654eb589136d8bcd19d033cb4f..c5b3a3666bc7973436e0137342c05d20523b457a 100644 (file)
@@ -1447,16 +1447,10 @@ static void convertEndian(B_UINT8 rwFlag, PUINT puiBuffer, UINT uiByteCount)
 
 int rdm(PMINI_ADAPTER Adapter, UINT uiAddress, PCHAR pucBuff, size_t sSize)
 {
-       INT uiRetVal =0;
-
-       uiRetVal = Adapter->interface_rdm(Adapter->pvInterfaceAdapter,
+       return Adapter->interface_rdm(Adapter->pvInterfaceAdapter,
                        uiAddress, pucBuff, sSize);
-
-       if(uiRetVal < 0)
-               return uiRetVal;
-
-       return uiRetVal;
 }
+
 int wrm(PMINI_ADAPTER Adapter, UINT uiAddress, PCHAR pucBuff, size_t sSize)
 {
        int iRetVal;
index 63e2173937e5f3321fab6d3448ab9fa42dfd260a..afafa577aadcc4cea080370031fb0639dc6f4dde 100644 (file)
@@ -4164,13 +4164,7 @@ s32 wl_cfg80211_down(void)
 
 static s32 wl_dongle_probecap(struct wl_priv *wl)
 {
-       s32 err = 0;
-
-       err = wl_update_wiphybands(wl);
-       if (unlikely(err))
-               return err;
-
-       return err;
+       return wl_update_wiphybands(wl);
 }
 
 static void *wl_read_prof(struct wl_priv *wl, s32 item)
index e7e72b8d8cdece8504f0adebc7279c135830f1fb..15a209f5b486859bf899091238b167f21f1229d6 100644 (file)
@@ -1291,10 +1291,10 @@ static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg,
                s->lock = file;
        spin_unlock_irqrestore(&s->spin_lock, flags);
 
+#if 0
        if (ret < 0)
                return ret;
 
-#if 0
        if (s->lock_f)
                ret = s->lock_f(dev, s);
 #endif
index 1d09bfa2edf5ca0b17046291b57bff03833f34d3..6637698e119ad7b36cfdec275f32322b4f6a9678 100644 (file)
@@ -1935,11 +1935,8 @@ static int usbdux_pwm_cancel(struct comedi_device *dev,
        dev_dbg(&this_usbduxsub->interface->dev,
                "comedi %d: sending pwm off command to the usb device.\n",
                dev->minor);
-       res = send_dux_commands(this_usbduxsub, SENDPWMOFF);
-       if (res < 0)
-               return res;
 
-       return res;
+       return send_dux_commands(this_usbduxsub, SENDPWMOFF);
 }
 
 static void usbduxsub_pwm_irq(struct urb *urb)
index a69c82e1199129a56944d6ad145aa62bfeb26e06..9c516cde80479f3f726cdf76231415ebc0bf93f8 100644 (file)
@@ -994,11 +994,7 @@ static int fill_board_specific_data(struct tm6000_core *dev)
        if (rc < 0)
                return rc;
 
-       rc = v4l2_device_register(&dev->udev->dev, &dev->v4l2_dev);
-       if (rc < 0)
-               return rc;
-
-       return rc;
+       return v4l2_device_register(&dev->udev->dev, &dev->v4l2_dev);
 }