diff options
author | Haneen Mohammed <hamohammed.sa@gmail.com> | 2015-03-06 22:01:38 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-06 15:55:36 -0800 |
commit | ce82410c76374be44a4dbd60b906e896a5e20687 (patch) | |
tree | 09f23c62222e7ba3d84278b4affa826e5c6b7415 | |
parent | 99beca13675c842b83d83e5d5b24d3a80dde1f58 (diff) |
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: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/comedi/drivers/ni_mio_common.c | 4 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/usbduxsigma.c | 26 |
2 files changed, 13 insertions, 17 deletions
diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 176b64a6b567..97728d25da53 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -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(); diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c index 394969b7458c..f50cf8a8dada 100644 --- a/drivers/staging/comedi/drivers/usbduxsigma.c +++ b/drivers/staging/comedi/drivers/usbduxsigma.c @@ -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"); |