Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e37a97d44038700ff8c2f1080f71fdfc3a4c0c1e
Commit:     e37a97d44038700ff8c2f1080f71fdfc3a4c0c1e
Parent:     4bdd488f4bf7dc91b371fe160a4718b0a91bb2a4
Author:     Dmitry Torokhov <[EMAIL PROTECTED]>
AuthorDate: Thu May 3 00:57:29 2007 -0400
Committer:  Dmitry Torokhov <[EMAIL PROTECTED]>
CommitDate: Thu May 3 00:57:29 2007 -0400

    Input: drivers/usb/input - usb_buffer_free() cleanup
    
    usb_buffer_free() now handles NULLs so remove unneeded checks
    form callers.
    
    Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
---
 drivers/usb/input/ati_remote2.c    |    4 +---
 drivers/usb/input/powermate.c      |   10 ++++------
 drivers/usb/input/usbtouchscreen.c |    5 ++---
 drivers/usb/input/yealink.c        |   23 +++++++++++------------
 4 files changed, 18 insertions(+), 24 deletions(-)

diff --git a/drivers/usb/input/ati_remote2.c b/drivers/usb/input/ati_remote2.c
index a9032aa..1031543 100644
--- a/drivers/usb/input/ati_remote2.c
+++ b/drivers/usb/input/ati_remote2.c
@@ -405,9 +405,7 @@ static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2)
 
        for (i = 0; i < 2; i++) {
                usb_free_urb(ar2->urb[i]);
-
-               if (ar2->buf[i])
-                       usb_buffer_free(ar2->udev, 4, ar2->buf[i], 
ar2->buf_dma[i]);
+               usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
        }
 }
 
diff --git a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c
index 4f93a76..448a470 100644
--- a/drivers/usb/input/powermate.c
+++ b/drivers/usb/input/powermate.c
@@ -291,12 +291,10 @@ static int powermate_alloc_buffers(struct usb_device 
*udev, struct powermate_dev
 
 static void powermate_free_buffers(struct usb_device *udev, struct 
powermate_device *pm)
 {
-       if (pm->data)
-               usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX,
-                               pm->data, pm->data_dma);
-       if (pm->configcr)
-               usb_buffer_free(udev, sizeof(*(pm->configcr)),
-                               pm->configcr, pm->configcr_dma);
+       usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX,
+                       pm->data, pm->data_dma);
+       usb_buffer_free(udev, sizeof(*(pm->configcr)),
+                       pm->configcr, pm->configcr_dma);
 }
 
 /* Called whenever a USB device matching one in our supported devices table is 
connected */
diff --git a/drivers/usb/input/usbtouchscreen.c 
b/drivers/usb/input/usbtouchscreen.c
index e082941..8e18e6c 100644
--- a/drivers/usb/input/usbtouchscreen.c
+++ b/drivers/usb/input/usbtouchscreen.c
@@ -668,9 +668,8 @@ static void usbtouch_close(struct input_dev *input)
 static void usbtouch_free_buffers(struct usb_device *udev,
                                  struct usbtouch_usb *usbtouch)
 {
-       if (usbtouch->data)
-               usb_buffer_free(udev, usbtouch->type->rept_size,
-                               usbtouch->data, usbtouch->data_dma);
+       usb_buffer_free(udev, usbtouch->type->rept_size,
+                       usbtouch->data, usbtouch->data_dma);
        kfree(usbtouch->buffer);
 }
 
diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c
index c54f1a5..fc645b2 100644
--- a/drivers/usb/input/yealink.c
+++ b/drivers/usb/input/yealink.c
@@ -818,18 +818,17 @@ static int usb_cleanup(struct yealink_dev *yld, int err)
                else
                        input_unregister_device(yld->idev);
        }
-       if (yld->ctl_req)
-               usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
-                               yld->ctl_req, yld->ctl_req_dma);
-       if (yld->ctl_data)
-               usb_buffer_free(yld->udev, USB_PKT_LEN,
-                               yld->ctl_data, yld->ctl_dma);
-       if (yld->irq_data)
-               usb_buffer_free(yld->udev, USB_PKT_LEN,
-                               yld->irq_data, yld->irq_dma);
-
-       usb_free_urb(yld->urb_irq);     /* parameter validation in core/urb */
-       usb_free_urb(yld->urb_ctl);     /* parameter validation in core/urb */
+
+       usb_free_urb(yld->urb_irq);
+       usb_free_urb(yld->urb_ctl);
+
+       usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
+                       yld->ctl_req, yld->ctl_req_dma);
+       usb_buffer_free(yld->udev, USB_PKT_LEN,
+                       yld->ctl_data, yld->ctl_dma);
+       usb_buffer_free(yld->udev, USB_PKT_LEN,
+                       yld->irq_data, yld->irq_dma);
+
        kfree(yld);
        return err;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to