Commit ce82410c authored by Haneen Mohammed's avatar Haneen Mohammed Committed by Greg Kroah-Hartman

Staging: comedi: clean dev_err logging

This patch removes  __func__ from dev_err. dev_err includes information about:
(devcice, driver, specific instance of device, etc) in the log printout.
This was done using Coccinelle, with the following semantic patch:

@A@
expression E, R;
expression  msg;
@@

dev_err(E, msg, __func__, R);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
	m = e.replace("%s: ", "", 1);
	coccinelle.y = m;
elif(e.find("%s ") == True):
	m = e.replace("%s ", "", 1);
	coccinelle.y = m;
elif(e.find("%s:") == True):
	m = e.replace("%s:", "", 1);
	coccinelle.y = m;
else:
	m = e.replace("%s", "",1);
	coccinelle.y = m;

@c@
expression a.E, a.msg, a.R;
identifier  b.y;
@@

- dev_err(E, msg, __func__, R);
+ dev_err(E, y, R);
Signed-off-by: default avatarHaneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 99beca13
...@@ -670,8 +670,8 @@ static inline void ni_set_bitfield(struct comedi_device *dev, int reg, ...@@ -670,8 +670,8 @@ static inline void ni_set_bitfield(struct comedi_device *dev, int reg,
ni_writeb(dev, devpriv->g0_g1_select_reg, G0_G1_Select); ni_writeb(dev, devpriv->g0_g1_select_reg, G0_G1_Select);
break; break;
default: default:
dev_err(dev->class_dev, dev_err(dev->class_dev, "called with invalid register %d\n",
"%s called with invalid register %d\n", __func__, reg); reg);
break; break;
} }
mmiowb(); mmiowb();
......
...@@ -243,9 +243,8 @@ static void usbduxsigma_ai_handle_urb(struct comedi_device *dev, ...@@ -243,9 +243,8 @@ static void usbduxsigma_ai_handle_urb(struct comedi_device *dev,
urb->dev = comedi_to_usb_dev(dev); urb->dev = comedi_to_usb_dev(dev);
ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret < 0) { if (ret < 0) {
dev_err(dev->class_dev, dev_err(dev->class_dev, "urb resubmit failed (%d)\n",
"%s: urb resubmit failed (%d)\n", ret);
__func__, ret);
if (ret == -EL2NSYNC) if (ret == -EL2NSYNC)
dev_err(dev->class_dev, dev_err(dev->class_dev,
"buggy USB host controller or bug in IRQ handler\n"); "buggy USB host controller or bug in IRQ handler\n");
...@@ -292,8 +291,8 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb) ...@@ -292,8 +291,8 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb)
default: default:
/* a real error */ /* a real error */
dev_err(dev->class_dev, "%s: non-zero urb status (%d)\n", dev_err(dev->class_dev, "non-zero urb status (%d)\n",
__func__, urb->status); urb->status);
async->events |= COMEDI_CB_ERROR; async->events |= COMEDI_CB_ERROR;
break; break;
} }
...@@ -386,9 +385,8 @@ static void usbduxsigma_ao_handle_urb(struct comedi_device *dev, ...@@ -386,9 +385,8 @@ static void usbduxsigma_ao_handle_urb(struct comedi_device *dev,
urb->iso_frame_desc[0].status = 0; urb->iso_frame_desc[0].status = 0;
ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret < 0) { if (ret < 0) {
dev_err(dev->class_dev, dev_err(dev->class_dev, "urb resubmit failed (%d)\n",
"%s: urb resubmit failed (%d)\n", ret);
__func__, ret);
if (ret == -EL2NSYNC) if (ret == -EL2NSYNC)
dev_err(dev->class_dev, dev_err(dev->class_dev,
"buggy USB host controller or bug in IRQ handler\n"); "buggy USB host controller or bug in IRQ handler\n");
...@@ -423,8 +421,8 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb) ...@@ -423,8 +421,8 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb)
default: default:
/* a real error */ /* a real error */
dev_err(dev->class_dev, "%s: non-zero urb status (%d)\n", dev_err(dev->class_dev, "non-zero urb status (%d)\n",
__func__, urb->status); urb->status);
async->events |= COMEDI_CB_ERROR; async->events |= COMEDI_CB_ERROR;
break; break;
} }
...@@ -1071,9 +1069,8 @@ static void usbduxsigma_pwm_urb_complete(struct urb *urb) ...@@ -1071,9 +1069,8 @@ static void usbduxsigma_pwm_urb_complete(struct urb *urb)
default: default:
/* a real error */ /* a real error */
if (devpriv->pwm_cmd_running) { if (devpriv->pwm_cmd_running) {
dev_err(dev->class_dev, dev_err(dev->class_dev, "non-zero urb status (%d)\n",
"%s: non-zero urb status (%d)\n", urb->status);
__func__, urb->status);
usbduxsigma_pwm_stop(dev, 0); /* w/o unlink */ usbduxsigma_pwm_stop(dev, 0); /* w/o unlink */
} }
return; return;
...@@ -1087,8 +1084,7 @@ static void usbduxsigma_pwm_urb_complete(struct urb *urb) ...@@ -1087,8 +1084,7 @@ static void usbduxsigma_pwm_urb_complete(struct urb *urb)
urb->status = 0; urb->status = 0;
ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret < 0) { if (ret < 0) {
dev_err(dev->class_dev, "%s: urb resubmit failed (%d)\n", dev_err(dev->class_dev, "urb resubmit failed (%d)\n", ret);
__func__, ret);
if (ret == -EL2NSYNC) if (ret == -EL2NSYNC)
dev_err(dev->class_dev, dev_err(dev->class_dev,
"buggy USB host controller or bug in IRQ handler\n"); "buggy USB host controller or bug in IRQ handler\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