Staging: winbond: usb_free_urb(NULL) is safe
authorHarsh Kumar <harsh1kumar@gmail.com>
Thu, 30 May 2013 04:35:02 +0000 (10:05 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2013 11:59:47 +0000 (20:59 +0900)
usb_free_urb(NULL) is safe. So, the check was removed. Also, couple of checkpatch.pl fixes

Signed-off-by: Harsh Kumar <harsh1kumar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/winbond/phy_calibration.c
drivers/staging/winbond/wb35reg.c
drivers/staging/winbond/wb35rx.c

index cabae346670438485689f734557447656b9bf198..cfbfbbb53866cbfd08f31592fc1c78d3c2db6a6a 100644 (file)
@@ -296,7 +296,7 @@ void _sin_cos(s32 angle, s32 *sin, s32 *cos)
        }
 }
 
-static unsigned char hal_get_dxx_reg(struct hw_data *pHwData, u16 number, u32 * pValue)
+static unsigned char hal_get_dxx_reg(struct hw_data *pHwData, u16 number, u32 *pValue)
 {
        if (number < 0x1000)
                number += 0x1000;
index 1bff7d1c9a772aea2fa786e70222d345436de22c..01942049dd391a1101471a4a51d39fa76789ce85 100644 (file)
@@ -64,12 +64,11 @@ unsigned char Wb35Reg_BurstWrite(struct hw_data *pHwData, u16 RegisterNo, u32 *p
 
                return true;
        } else {
-               if (urb)
-                       usb_free_urb(urb);
+               usb_free_urb(urb);
                kfree(reg_queue);
                return false;
        }
-   return false;
+       return false;
 }
 
 void Wb35Reg_Update(struct hw_data *pHwData,  u16 RegisterNo,  u32 RegisterValue)
@@ -206,8 +205,7 @@ unsigned char Wb35Reg_Write(struct hw_data *pHwData, u16 RegisterNo, u32 Registe
 
                return true;
        } else {
-               if (urb)
-                       usb_free_urb(urb);
+               usb_free_urb(urb);
                kfree(reg_queue);
                return false;
        }
@@ -270,8 +268,7 @@ unsigned char Wb35Reg_WriteWithCallbackValue(struct hw_data *pHwData,
                Wb35Reg_EP0VM_start(pHwData);
                return true;
        } else {
-               if (urb)
-                       usb_free_urb(urb);
+               usb_free_urb(urb);
                kfree(reg_queue);
                return false;
        }
@@ -374,8 +371,7 @@ unsigned char Wb35Reg_Read(struct hw_data *pHwData, u16 RegisterNo, u32 *pRegist
 
                return true;
        } else {
-               if (urb)
-                       usb_free_urb(urb);
+               usb_free_urb(urb);
                kfree(reg_queue);
                return false;
        }
index f118eeba396ae195bb77da4a9d8a518570accbe4..8d71bc2f5940b6f2037a225e00528fd8ee71bc43 100644 (file)
@@ -343,8 +343,7 @@ void Wb35Rx_destroy(struct hw_data *pHwData)
        } while (pWb35Rx->EP3vm_state != VM_STOP);
        msleep(10); /* Delay for waiting function exit */
 
-       if (pWb35Rx->RxUrb)
-               usb_free_urb(pWb35Rx->RxUrb);
+       usb_free_urb(pWb35Rx->RxUrb);
        pr_debug("Wb35Rx_destroy OK\n");
 }