From 52150c78270db56ef5c0de0bf9d13d1d437d1236 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 1 Mar 2017 17:35:07 -0800 Subject: HID: usbhid: Use pr_ 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 Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina --- drivers/hid/usbhid/hid-quirks.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'drivers/hid/usbhid/hid-quirks.c') diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index d6847a664446..9287ab03e117 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c @@ -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); - if (!q_new) { - dbg_hid("Could not allocate quirks_list_struct\n"); + if (!q_new) return -ENOMEM; - } q_new->hid_bl_item.idVendor = idVendor; q_new->hid_bl_item.idProduct = idProduct; @@ -306,10 +304,9 @@ int usbhid_quirks_init(char **quirks_param) &idVendor, &idProduct, &quirks); if (m != 3 || - usbhid_modify_dquirk(idVendor, idProduct, quirks) != 0) { - printk(KERN_WARNING - "Could not parse HID quirk module param %s\n", - quirks_param[n]); + usbhid_modify_dquirk(idVendor, idProduct, quirks) != 0) { + pr_warn("Could not parse HID quirk module param %s\n", + quirks_param[n]); } } -- cgit v1.2.3