Staging: emxx_udc: Remove __func__ from dev_err
PATCH 1/1 Staging: emxx_udc: Remove __func__ from dev_err
This patch removes __func__ argument from dev_err as dev_err includes the function name in the log printout, so there is no need to include it manually.
Found using coccinelle:
@a@
expression E;
expression msg;
@@
dev_err(E, msg, __func__);
@script:python b@
e << a.msg;
y;
@@
if(e.find("%s: ") == True):
m = e.replace("%s: ", "");
coccinelle.y = m;
elif(e.find("%s ") == True):
m = e.replace("%s ", "");
coccinelle.y = m;
else:
m = e.replace("%s", "");@c@
expression a.E, a.msg;
identifier b.y;
@@
- dev_err(E, msg, __func__);
+ dev_err(E, y);
--- drivers/staging/emxx_udc/emxx_udc.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
drivers/staging/emxx_udc/emxx_udc.c +8 -10
@@ -2561,7 +2561,7 @@ static int nbu2ss_ep_enable(if ((!udc->driver) || (udc->gadget.speed ==USB_SPEED_UNKNOWN )) { -dev_err (ep->udc->dev," *** %s, udc !!\n" , __func__); +dev_err (ep->udc->dev,"udc !!\n" );return -ESHUTDOWN ; }
@@ -2700,8 +2700,7 @@ static int nbu2ss_ep_queue( }if (unlikely (!udc->driver)) { -dev_err (udc->dev,"%s, bogus device state %p\n" , __func__, - udc->driver); +dev_err (udc->dev,"bogus device state %p\n" , udc->driver);return -ESHUTDOWN ; }
@@ -2740,8 +2739,7 @@ static int nbu2ss_ep_queue( result =_nbu2ss_start_transfer (udc, ep, req, FALSE);if (result <0 ) { -dev_err (udc->dev," *** %s, result = %d\n" , __func__, - result); +dev_err (udc->dev,"result = %d\n" , result);list_del (&req->queue); }else if ((ep->epnum >0 ) && (ep->direct ==USB_DIR_OUT )) {#ifdef USE_DMA
@@ -2827,7 +2825,7 @@ static int nbu2ss_ep_set_halt(struct usb_ep *_ep, int value) udc = ep->udc;if (!udc) { -dev_err (ep->udc->dev," *** %s, bad udc\n" , __func__); +dev_err (ep->udc->dev,"bad udc\n" );return -EINVAL ; }
@@ -2879,7 +2877,7 @@ static int nbu2ss_ep_fifo_status(struct usb_ep *_ep) udc = ep->udc;if (!udc) { -dev_err (ep->udc->dev,"%s, bad udc\n" , __func__); +dev_err (ep->udc->dev,"bad udc\n" );return -EINVAL ; }
@@ -2925,7 +2923,7 @@ static void nbu2ss_ep_fifo_flush(struct usb_ep *_ep) udc = ep->udc;if (!udc) { -dev_err (ep->udc->dev,"%s, bad udc\n" , __func__); +dev_err (ep->udc->dev,"bad udc\n" );return ; }
@@ -2972,7 +2970,7 @@ static int nbu2ss_gad_get_frame(struct usb_gadget *pgadget) udc = container_of(pgadget, struct nbu2ss_udc, gadget);if (!udc) { -dev_err (&pgadget->dev,"%s, udc == NULL\n" , __func__); +dev_err (&pgadget->dev,"udc == NULL\n" );return -EINVAL ; }
@@ -3000,7 +2998,7 @@ static int nbu2ss_gad_wakeup(struct usb_gadget *pgadget) udc = container_of(pgadget, struct nbu2ss_udc, gadget);if (!udc) { -dev_err (&pgadget->dev,"%s, udc == NULL\n" , __func__); +dev_err (&pgadget->dev,"udc == NULL\n" );return -EINVAL ; }
Signature · 1 line
1.9.1
Greg KH
maintainerQuoted 3 lines · Bhumika Goyal
This patch removes
__func__argument fromdev_errasdev_errincludes the function name in the log printout, so there is no need to include it manually.
No it doesn't, the function name isn't there, only the device name. I can't take this patch :(
Quoted 8 lines · Greg KH
Quoted 3 lines · Bhumika Goyal
This patch removes
__func__argument fromdev_errasdev_errincludes the function name in the log printout, so there is no need to include it manually.No it doesn't, the function name isn't there, only the device name. I can't take this patch :(
Thanks for the feedback. I get the point and will try to make my understanding of dev_err more clear.
Thanks
Bhumika