Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6675c5bd2a0ec223888b42cf97bc7dc900bf31fb
Commit:     6675c5bd2a0ec223888b42cf97bc7dc900bf31fb
Parent:     66da876962f782a3974b4a957d12f20656584a4d
Author:     Dmitry Torokhov <[EMAIL PROTECTED]>
AuthorDate: Thu May 3 01:04:52 2007 -0400
Committer:  Jiri Kosina <[EMAIL PROTECTED]>
CommitDate: Wed May 9 02:52:51 2007 +0200

    USB HID: usb_buffer_free() cleanup
    
    usb_buffer_free() now handles NULLs so remove unneeded checks
    form callers.
    
    Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
    Signed-off-by: Jiri Kosina <[EMAIL PROTECTED]>
---
 drivers/hid/usbhid/hid-core.c |   12 ++++--------
 drivers/hid/usbhid/usbkbd.c   |    9 +++------
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 1c0bd48..d06b9e7 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -626,14 +626,10 @@ static void hid_free_buffers(struct usb_device *dev, 
struct hid_device *hid)
 {
        struct usbhid_device *usbhid = hid->driver_data;
 
-       if (usbhid->inbuf)
-               usb_buffer_free(dev, usbhid->bufsize, usbhid->inbuf, 
usbhid->inbuf_dma);
-       if (usbhid->outbuf)
-               usb_buffer_free(dev, usbhid->bufsize, usbhid->outbuf, 
usbhid->outbuf_dma);
-       if (usbhid->cr)
-               usb_buffer_free(dev, sizeof(*(usbhid->cr)), usbhid->cr, 
usbhid->cr_dma);
-       if (usbhid->ctrlbuf)
-               usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, 
usbhid->ctrlbuf_dma);
+       usb_buffer_free(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma);
+       usb_buffer_free(dev, usbhid->bufsize, usbhid->outbuf, 
usbhid->outbuf_dma);
+       usb_buffer_free(dev, sizeof(*(usbhid->cr)), usbhid->cr, usbhid->cr_dma);
+       usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, 
usbhid->ctrlbuf_dma);
 }
 
 /*
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
index 65aa12e..36ddc7a 100644
--- a/drivers/hid/usbhid/usbkbd.c
+++ b/drivers/hid/usbhid/usbkbd.c
@@ -211,12 +211,9 @@ static void usb_kbd_free_mem(struct usb_device *dev, 
struct usb_kbd *kbd)
 {
        usb_free_urb(kbd->irq);
        usb_free_urb(kbd->led);
-       if (kbd->new)
-               usb_buffer_free(dev, 8, kbd->new, kbd->new_dma);
-       if (kbd->cr)
-               usb_buffer_free(dev, sizeof(struct usb_ctrlrequest), kbd->cr, 
kbd->cr_dma);
-       if (kbd->leds)
-               usb_buffer_free(dev, 1, kbd->leds, kbd->leds_dma);
+       usb_buffer_free(dev, 8, kbd->new, kbd->new_dma);
+       usb_buffer_free(dev, sizeof(struct usb_ctrlrequest), kbd->cr, 
kbd->cr_dma);
+       usb_buffer_free(dev, 1, kbd->leds, kbd->leds_dma);
 }
 
 static int usb_kbd_probe(struct usb_interface *iface,
-
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