From ce82410c76374be44a4dbd60b906e896a5e20687 Mon Sep 17 00:00:00 2001 From: Haneen Mohammed Date: Fri, 6 Mar 2015 22:01:38 +0300 Subject: [PATCH] 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 Signed-off-by: Greg Kroah-Hartman --- .../staging/comedi/drivers/ni_mio_common.c | 4 +-- 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"); -- 2.30.2