diff options
author | Joe Perches <joe@perches.com> | 2017-03-02 04:35:07 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2017-03-06 16:40:34 +0300 |
commit | 52150c78270db56ef5c0de0bf9d13d1d437d1236 (patch) | |
tree | a37cd751e12c3df714567c6ade5a7fc51b34d910 /drivers/hid/usbhid/hid-core.c | |
parent | 933bfe4d271ef5931bc7513a1239751ed251db04 (diff) | |
download | linux-52150c78270db56ef5c0de0bf9d13d1d437d1236.tar.xz |
HID: usbhid: Use pr_<level> and remove unnecessary OOM messages
Use a more common logging style and remove the unnecessary
OOM messages as there is default dump_stack when OOM.
Miscellanea:
o Hoist an assignment in an if
o Realign arguments
o Realign a deeply indented if descendent above a printk
Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid/hid-core.c')
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index b06fee1b8e47..9ef9c0837d95 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1008,10 +1008,9 @@ static int usbhid_parse(struct hid_device *hid) return -EINVAL; } - if (!(rdesc = kmalloc(rsize, GFP_KERNEL))) { - dbg_hid("couldn't allocate rdesc memory\n"); + rdesc = kmalloc(rsize, GFP_KERNEL); + if (!rdesc) return -ENOMEM; - } hid_set_idle(dev, interface->desc.bInterfaceNumber, 0, 0); @@ -1081,8 +1080,8 @@ static int usbhid_start(struct hid_device *hid) if (hid->quirks & HID_QUIRK_FULLSPEED_INTERVAL && dev->speed == USB_SPEED_HIGH) { interval = fls(endpoint->bInterval*8); - printk(KERN_INFO "%s: Fixing fullspeed to highspeed interval: %d -> %d\n", - hid->name, endpoint->bInterval, interval); + pr_info("%s: Fixing fullspeed to highspeed interval: %d -> %d\n", + hid->name, endpoint->bInterval, interval); } /* Change the polling interval of mice and joysticks. */ @@ -1468,10 +1467,9 @@ static int hid_post_reset(struct usb_interface *intf) * the size of the HID report descriptor has not changed. */ rdesc = kmalloc(hid->dev_rsize, GFP_KERNEL); - if (!rdesc) { - dbg_hid("couldn't allocate rdesc memory (post_reset)\n"); + if (!rdesc) return -ENOMEM; - } + status = hid_get_class_descriptor(dev, interface->desc.bInterfaceNumber, HID_DT_REPORT, rdesc, hid->dev_rsize); @@ -1649,7 +1647,7 @@ static int __init hid_init(void) retval = usb_register(&hid_driver); if (retval) goto usb_register_fail; - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); + pr_info(KBUILD_MODNAME ": " DRIVER_DESC "\n"); return 0; usb_register_fail: |