Skip to contentSkip to conversation

watchdog: don't print error when allocating urb fails

PATCH New Wolfram Sang 2 participants 3 messages Aug 11, 2016 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: don't print error when allocating urb fails

This per-subsystem series is part of a tree wide cleanup. usb_alloc_urb() uses kmalloc which already prints enough information on failure. So, let's simply remove those "allocation failed" messages from drivers like we did already for other -ENOMEM cases. gkh acked this approach when we talked about it at LCJ in Tokyo a few weeks ago.

Wolfram Sang (1):
watchdog: pcwd_usb: don't print error when allocating urb fails

 drivers/watchdog/pcwd_usb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/1 watchdog: pcwd_usb: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

---
 drivers/watchdog/pcwd_usb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/pcwd_usb.c +1 -3
index 68952d9ccf8394..99ebf6ea3de648 100644
@@ -666,10 +666,8 @@ static int usb_pcwd_probe(struct usb_interface *interface,
 
 	/* allocate the urb's */
 	usb_pcwd->intr_urb = usb_alloc_urb(0, GFP_KERNEL);
-	if (!usb_pcwd->intr_urb) {
-		pr_err("Out of memory\n");
+	if (!usb_pcwd->intr_urb)
 		goto error;
-	}
 
 	/* initialise the intr urb's */
 	usb_fill_int_urb(usb_pcwd->intr_urb, udev, pipe,
Signature · 1 line
2.8.1
maintainer Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH] watchdog: pcwd_usb: don't print error when allocating urb fails

Quoted 3 lines · Wolfram Sang

kmalloc will print enough information in case of failure.

Quoted 23 lines
---
 drivers/watchdog/pcwd_usb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/pcwd_usb.c +1 -3
index 68952d9ccf8394..99ebf6ea3de648 100644
@@ -666,10 +666,8 @@ static int usb_pcwd_probe(struct usb_interface *interface,
 
 	/* allocate the urb's */
 	usb_pcwd->intr_urb = usb_alloc_urb(0, GFP_KERNEL);
-	if (!usb_pcwd->intr_urb) {
-		pr_err("Out of memory\n");
+	if (!usb_pcwd->intr_urb)
 		goto error;
-	}
 
 	/* initialise the intr urb's */
 	usb_fill_int_urb(usb_pcwd->intr_urb, udev, pipe,
Signature · 1 line
2.8.1