Commit 52150c78 authored by Joe Perches's avatar Joe Perches Committed by Jiri Kosina

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: default avatarJoe Perches <joe@perches.com>
Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 933bfe4d
...@@ -1008,10 +1008,9 @@ static int usbhid_parse(struct hid_device *hid) ...@@ -1008,10 +1008,9 @@ static int usbhid_parse(struct hid_device *hid)
return -EINVAL; return -EINVAL;
} }
if (!(rdesc = kmalloc(rsize, GFP_KERNEL))) { rdesc = kmalloc(rsize, GFP_KERNEL);
dbg_hid("couldn't allocate rdesc memory\n"); if (!rdesc)
return -ENOMEM; return -ENOMEM;
}
hid_set_idle(dev, interface->desc.bInterfaceNumber, 0, 0); hid_set_idle(dev, interface->desc.bInterfaceNumber, 0, 0);
...@@ -1081,8 +1080,8 @@ static int usbhid_start(struct hid_device *hid) ...@@ -1081,8 +1080,8 @@ static int usbhid_start(struct hid_device *hid)
if (hid->quirks & HID_QUIRK_FULLSPEED_INTERVAL && if (hid->quirks & HID_QUIRK_FULLSPEED_INTERVAL &&
dev->speed == USB_SPEED_HIGH) { dev->speed == USB_SPEED_HIGH) {
interval = fls(endpoint->bInterval*8); interval = fls(endpoint->bInterval*8);
printk(KERN_INFO "%s: Fixing fullspeed to highspeed interval: %d -> %d\n", pr_info("%s: Fixing fullspeed to highspeed interval: %d -> %d\n",
hid->name, endpoint->bInterval, interval); hid->name, endpoint->bInterval, interval);
} }
/* Change the polling interval of mice and joysticks. */ /* Change the polling interval of mice and joysticks. */
...@@ -1468,10 +1467,9 @@ static int hid_post_reset(struct usb_interface *intf) ...@@ -1468,10 +1467,9 @@ static int hid_post_reset(struct usb_interface *intf)
* the size of the HID report descriptor has not changed. * the size of the HID report descriptor has not changed.
*/ */
rdesc = kmalloc(hid->dev_rsize, GFP_KERNEL); rdesc = kmalloc(hid->dev_rsize, GFP_KERNEL);
if (!rdesc) { if (!rdesc)
dbg_hid("couldn't allocate rdesc memory (post_reset)\n");
return -ENOMEM; return -ENOMEM;
}
status = hid_get_class_descriptor(dev, status = hid_get_class_descriptor(dev,
interface->desc.bInterfaceNumber, interface->desc.bInterfaceNumber,
HID_DT_REPORT, rdesc, hid->dev_rsize); HID_DT_REPORT, rdesc, hid->dev_rsize);
...@@ -1649,7 +1647,7 @@ static int __init hid_init(void) ...@@ -1649,7 +1647,7 @@ static int __init hid_init(void)
retval = usb_register(&hid_driver); retval = usb_register(&hid_driver);
if (retval) if (retval)
goto usb_register_fail; goto usb_register_fail;
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); pr_info(KBUILD_MODNAME ": " DRIVER_DESC "\n");
return 0; return 0;
usb_register_fail: usb_register_fail:
......
...@@ -237,10 +237,8 @@ static int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, ...@@ -237,10 +237,8 @@ static int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct,
} }
q_new = kmalloc(sizeof(struct quirks_list_struct), GFP_KERNEL); q_new = kmalloc(sizeof(struct quirks_list_struct), GFP_KERNEL);
if (!q_new) { if (!q_new)
dbg_hid("Could not allocate quirks_list_struct\n");
return -ENOMEM; return -ENOMEM;
}
q_new->hid_bl_item.idVendor = idVendor; q_new->hid_bl_item.idVendor = idVendor;
q_new->hid_bl_item.idProduct = idProduct; q_new->hid_bl_item.idProduct = idProduct;
...@@ -306,10 +304,9 @@ int usbhid_quirks_init(char **quirks_param) ...@@ -306,10 +304,9 @@ int usbhid_quirks_init(char **quirks_param)
&idVendor, &idProduct, &quirks); &idVendor, &idProduct, &quirks);
if (m != 3 || if (m != 3 ||
usbhid_modify_dquirk(idVendor, idProduct, quirks) != 0) { usbhid_modify_dquirk(idVendor, idProduct, quirks) != 0) {
printk(KERN_WARNING pr_warn("Could not parse HID quirk module param %s\n",
"Could not parse HID quirk module param %s\n", quirks_param[n]);
quirks_param[n]);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment