From: Haneen Mohammed Date: Fri, 6 Mar 2015 19:00:10 +0000 (+0300) Subject: Staging: media: clean dev_err logging X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8c6ccbeb510fe48ed8808067cd7cbf92f7e8ebac;p=openwrt%2Fstaging%2Fblogic.git Staging: media: 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 --- diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index 9ce7d9990e3e..2e883e9457db 100644 --- a/drivers/staging/media/lirc/lirc_imon.c +++ b/drivers/staging/media/lirc/lirc_imon.c @@ -208,8 +208,7 @@ static void deregister_from_lirc(struct imon_context *context) retval = lirc_unregister_driver(minor); if (retval) dev_err(&context->usbdev->dev, - ": %s: unable to deregister from lirc(%d)", - __func__, retval); + "unable to deregister from lirc(%d)", retval); else dev_info(&context->usbdev->dev, "Deregistered iMON driver (minor:%d)\n", minor); @@ -241,9 +240,8 @@ static int display_open(struct inode *inode, struct file *file) context = usb_get_intfdata(interface); if (!context) { - dev_err(&interface->dev, - "%s: no context found for minor %d\n", - __func__, subminor); + dev_err(&interface->dev, "no context found for minor %d\n", + subminor); retval = -ENODEV; goto exit; } @@ -344,8 +342,8 @@ static int send_packet(struct imon_context *context) retval = usb_submit_urb(context->tx_urb, GFP_KERNEL); if (retval) { atomic_set(&(context->tx.busy), 0); - dev_err(&context->usbdev->dev, - "%s: error submitting urb(%d)\n", __func__, retval); + dev_err(&context->usbdev->dev, "error submitting urb(%d)\n", + retval); } else { /* Wait for transmission to complete (or abort) */ mutex_unlock(&context->ctx_lock); @@ -359,8 +357,7 @@ static int send_packet(struct imon_context *context) retval = context->tx.status; if (retval) dev_err(&context->usbdev->dev, - "%s: packet tx failed (%d)\n", - __func__, retval); + "packet tx failed (%d)\n", retval); } return retval; @@ -437,8 +434,8 @@ static ssize_t vfd_write(struct file *file, const char __user *buf, retval = send_packet(context); if (retval) { dev_err(&context->usbdev->dev, - "%s: send packet failed for packet #%d\n", - __func__, seq/2); + "send packet failed for packet #%d\n", + seq / 2); goto exit; } else { seq += 2; @@ -454,8 +451,8 @@ static ssize_t vfd_write(struct file *file, const char __user *buf, retval = send_packet(context); if (retval) dev_err(&context->usbdev->dev, - "%s: send packet failed for packet #%d\n", - __func__, seq/2); + "send packet failed for packet #%d\n", + seq / 2); } exit: @@ -877,8 +874,7 @@ static int imon_probe(struct usb_interface *interface, retval = usb_submit_urb(context->rx_urb, GFP_KERNEL); if (retval) { - dev_err(dev, "%s: usb_submit_urb failed for intf0 (%d)\n", - __func__, retval); + dev_err(dev, "usb_submit_urb failed for intf0 (%d)\n", retval); alloc_status = 8; goto unlock; } diff --git a/drivers/staging/media/lirc/lirc_sasem.c b/drivers/staging/media/lirc/lirc_sasem.c index 4a268200cbf5..9944af1ba4d3 100644 --- a/drivers/staging/media/lirc/lirc_sasem.c +++ b/drivers/staging/media/lirc/lirc_sasem.c @@ -214,9 +214,8 @@ static int vfd_open(struct inode *inode, struct file *file) context = usb_get_intfdata(interface); if (!context) { - dev_err(&interface->dev, - "%s: no context found for minor %d\n", - __func__, subminor); + dev_err(&interface->dev, "no context found for minor %d\n", + subminor); retval = -ENODEV; goto exit; } @@ -337,8 +336,8 @@ static int send_packet(struct sasem_context *context) retval = usb_submit_urb(context->tx_urb, GFP_KERNEL); if (retval) { atomic_set(&(context->tx.busy), 0); - dev_err(&context->dev->dev, "%s: error submitting urb (%d)\n", - __func__, retval); + dev_err(&context->dev->dev, "error submitting urb (%d)\n", + retval); } else { /* Wait for transmission to complete (or abort) */ mutex_unlock(&context->ctx_lock); @@ -348,8 +347,7 @@ static int send_packet(struct sasem_context *context) retval = context->tx.status; if (retval) dev_err(&context->dev->dev, - "%s: packet tx failed (%d)\n", - __func__, retval); + "packet tx failed (%d)\n", retval); } return retval; @@ -444,8 +442,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf, retval = send_packet(context); if (retval) { dev_err(&context->dev->dev, - "%s: send packet failed for packet #%d\n", - __func__, i); + "send packet failed for packet #%d\n", i); goto exit; } } @@ -509,8 +506,7 @@ static int ir_open(void *data) if (retval) dev_err(&context->dev->dev, - "%s: usb_submit_urb failed for ir_open (%d)\n", - __func__, retval); + "usb_submit_urb failed for ir_open (%d)\n", retval); else { context->ir_isopen = 1; dev_info(&context->dev->dev, "IR port opened\n"); diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c index 44b81a2c8b6f..e0ad5e520e2d 100644 --- a/drivers/staging/media/omap4iss/iss.c +++ b/drivers/staging/media/omap4iss/iss.c @@ -1160,8 +1160,8 @@ iss_register_subdev_group(struct iss_device *iss, subdev = v4l2_i2c_new_subdev_board(&iss->v4l2_dev, adapter, board_info->board_info, NULL); if (subdev == NULL) { - dev_err(iss->dev, "%s: Unable to register subdev %s\n", - __func__, board_info->board_info->type); + dev_err(iss->dev, "Unable to register subdev %s\n", + board_info->board_info->type); continue; } @@ -1185,16 +1185,16 @@ static int iss_register_entities(struct iss_device *iss) iss->media_dev.link_notify = iss_pipeline_link_notify; ret = media_device_register(&iss->media_dev); if (ret < 0) { - dev_err(iss->dev, "%s: Media device registration failed (%d)\n", - __func__, ret); + dev_err(iss->dev, "Media device registration failed (%d)\n", + ret); return ret; } iss->v4l2_dev.mdev = &iss->media_dev; ret = v4l2_device_register(iss->dev, &iss->v4l2_dev); if (ret < 0) { - dev_err(iss->dev, "%s: V4L2 device registration failed (%d)\n", - __func__, ret); + dev_err(iss->dev, "V4L2 device registration failed (%d)\n", + ret); goto done; } @@ -1252,8 +1252,8 @@ static int iss_register_entities(struct iss_device *iss) break; default: - dev_err(iss->dev, "%s: invalid interface type %u\n", - __func__, subdevs->interface); + dev_err(iss->dev, "invalid interface type %u\n", + subdevs->interface); ret = -EINVAL; goto done; } diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c index 69550445a341..55938cccde7f 100644 --- a/drivers/staging/media/omap4iss/iss_video.c +++ b/drivers/staging/media/omap4iss/iss_video.c @@ -1221,8 +1221,7 @@ int omap4iss_video_register(struct iss_video *video, struct v4l2_device *vdev) ret = video_register_device(&video->video, VFL_TYPE_GRABBER, -1); if (ret < 0) dev_err(video->iss->dev, - "%s: could not register video device (%d)\n", - __func__, ret); + "could not register video device (%d)\n", ret); return ret; }