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,
ni_writeb(dev, devpriv->g0_g1_select_reg, G0_G1_Select);
break;
default:
dev_err(dev->class_dev,
"%s called with invalid register %d\n", __func__, reg);
dev_err(dev->class_dev, "called with invalid register %d\n",
reg);
break;
}
mmiowb();
......
......@@ -243,9 +243,8 @@ static void usbduxsigma_ai_handle_urb(struct comedi_device *dev,
urb->dev = comedi_to_usb_dev(dev);
ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret < 0) {
dev_err(dev->class_dev,
"%s: urb resubmit failed (%d)\n",
__func__, ret);
dev_err(dev->class_dev, "urb resubmit failed (%d)\n",
ret);
if (ret == -EL2NSYNC)
dev_err(dev->class_dev,
"buggy USB host controller or bug in IRQ handler\n");
......@@ -292,8 +291,8 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb)
default:
/* a real error */
dev_err(dev->class_dev, "%s: non-zero urb status (%d)\n",
__func__, urb->status);
dev_err(dev->class_dev, "non-zero urb status (%d)\n",
urb->status);
async->events |= COMEDI_CB_ERROR;
break;
}
......@@ -386,9 +385,8 @@ static void usbduxsigma_ao_handle_urb(struct comedi_device *dev,
urb->iso_frame_desc[0].status = 0;
ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret < 0) {
dev_err(dev->class_dev,
"%s: urb resubmit failed (%d)\n",
__func__, ret);
dev_err(dev->class_dev, "urb resubmit failed (%d)\n",
ret);
if (ret == -EL2NSYNC)
dev_err(dev->class_dev,
"buggy USB host controller or bug in IRQ handler\n");
......@@ -423,8 +421,8 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb)
default:
/* a real error */
dev_err(dev->class_dev, "%s: non-zero urb status (%d)\n",
__func__, urb->status);
dev_err(dev->class_dev, "non-zero urb status (%d)\n",
urb->status);
async->events |= COMEDI_CB_ERROR;
break;
}
......@@ -1071,9 +1069,8 @@ static void usbduxsigma_pwm_urb_complete(struct urb *urb)
default:
/* a real error */
if (devpriv->pwm_cmd_running) {
dev_err(dev->class_dev,
"%s: non-zero urb status (%d)\n",
__func__, urb->status);
dev_err(dev->class_dev, "non-zero urb status (%d)\n",
urb->status);
usbduxsigma_pwm_stop(dev, 0); /* w/o unlink */
}
return;
......@@ -1087,8 +1084,7 @@ static void usbduxsigma_pwm_urb_complete(struct urb *urb)
urb->status = 0;
ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret < 0) {
dev_err(dev->class_dev, "%s: urb resubmit failed (%d)\n",
__func__, ret);
dev_err(dev->class_dev, "urb resubmit failed (%d)\n", ret);
if (ret == -EL2NSYNC)
dev_err(dev->class_dev,
"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