All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: most: video: use __func__ instead of function name
@ 2018-05-03 10:21 Abdun Nihaal
  2018-05-07  1:54 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Abdun Nihaal @ 2018-05-03 10:21 UTC (permalink / raw)
  To: gregkh; +Cc: devel, Abdun Nihaal, linux-kernel

This fixes the following checkpatch warning in video.c:

WARNING: Prefer using '\"%s...\", __func__' to using function's name
in a string

Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
---
 drivers/staging/most/video/video.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
index 9d7e747519d9..c85e289275a9 100644
--- a/drivers/staging/most/video/video.c
+++ b/drivers/staging/most/video/video.c
@@ -73,7 +73,7 @@ static int comp_vdev_open(struct file *filp)
 	struct most_video_dev *mdev = video_drvdata(filp);
 	struct comp_fh *fh;
 
-	v4l2_info(&mdev->v4l2_dev, "comp_vdev_open()\n");
+	v4l2_info(&mdev->v4l2_dev, "%s()\n", __func__);
 
 	switch (vdev->vfl_type) {
 	case VFL_TYPE_GRABBER:
@@ -122,7 +122,7 @@ static int comp_vdev_close(struct file *filp)
 	struct most_video_dev *mdev = fh->mdev;
 	struct mbo *mbo, *tmp;
 
-	v4l2_info(&mdev->v4l2_dev, "comp_vdev_close()\n");
+	v4l2_info(&mdev->v4l2_dev, "%s()\n", __func__);
 
 	/*
 	 * We need to put MBOs back before we call most_stop_channel()
@@ -250,7 +250,7 @@ static int vidioc_querycap(struct file *file, void *priv,
 	struct comp_fh *fh = priv;
 	struct most_video_dev *mdev = fh->mdev;
 
-	v4l2_info(&mdev->v4l2_dev, "vidioc_querycap()\n");
+	v4l2_info(&mdev->v4l2_dev, "%s()\n", __func__);
 
 	strlcpy(cap->driver, "v4l2_component", sizeof(cap->driver));
 	strlcpy(cap->card, "MOST", sizeof(cap->card));
@@ -270,7 +270,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
 	struct comp_fh *fh = priv;
 	struct most_video_dev *mdev = fh->mdev;
 
-	v4l2_info(&mdev->v4l2_dev, "vidioc_enum_fmt_vid_cap() %d\n", f->index);
+	v4l2_info(&mdev->v4l2_dev, "%s() %d\n", __func__, f->index);
 
 	if (f->index)
 		return -EINVAL;
@@ -289,7 +289,7 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
 	struct comp_fh *fh = priv;
 	struct most_video_dev *mdev = fh->mdev;
 
-	v4l2_info(&mdev->v4l2_dev, "vidioc_g_fmt_vid_cap()\n");
+	v4l2_info(&mdev->v4l2_dev, "%s()\n", __func__);
 
 	comp_set_format_struct(f);
 	return 0;
@@ -318,7 +318,7 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm)
 	struct comp_fh *fh = priv;
 	struct most_video_dev *mdev = fh->mdev;
 
-	v4l2_info(&mdev->v4l2_dev, "vidioc_g_std()\n");
+	v4l2_info(&mdev->v4l2_dev, "%s()\n", __func__);
 
 	*norm = V4L2_STD_UNKNOWN;
 	return 0;
@@ -355,7 +355,7 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int index)
 	struct comp_fh *fh = priv;
 	struct most_video_dev *mdev = fh->mdev;
 
-	v4l2_info(&mdev->v4l2_dev, "vidioc_s_input(%d)\n", index);
+	v4l2_info(&mdev->v4l2_dev, "%s(%d)\n", __func__, index);
 
 	if (index >= V4L2_CMP_MAX_INPUT)
 		return -EINVAL;
@@ -435,7 +435,7 @@ static int comp_register_videodev(struct most_video_dev *mdev)
 {
 	int ret;
 
-	v4l2_info(&mdev->v4l2_dev, "comp_register_videodev()\n");
+	v4l2_info(&mdev->v4l2_dev, "%s()\n", __func__);
 
 	init_waitqueue_head(&mdev->wait_data);
 
@@ -465,7 +465,7 @@ static int comp_register_videodev(struct most_video_dev *mdev)
 
 static void comp_unregister_videodev(struct most_video_dev *mdev)
 {
-	v4l2_info(&mdev->v4l2_dev, "comp_unregister_videodev()\n");
+	v4l2_info(&mdev->v4l2_dev, "%s()\n", __func__);
 
 	video_unregister_device(mdev->vdev);
 }
@@ -485,7 +485,7 @@ static int comp_probe_channel(struct most_interface *iface, int channel_idx,
 	int ret;
 	struct most_video_dev *mdev = get_comp_dev(iface, channel_idx);
 
-	pr_info("comp_probe_channel(%s)\n", name);
+	pr_info("%s(%s)\n", __func__, name);
 
 	if (mdev) {
 		pr_err("channel already linked\n");
@@ -531,7 +531,7 @@ static int comp_probe_channel(struct most_interface *iface, int channel_idx,
 	spin_lock_irq(&list_lock);
 	list_add(&mdev->list, &video_devices);
 	spin_unlock_irq(&list_lock);
-	v4l2_info(&mdev->v4l2_dev, "comp_probe_channel() done\n");
+	v4l2_info(&mdev->v4l2_dev, "%s() done\n", __func__);
 	return 0;
 
 err_unreg:
@@ -550,7 +550,7 @@ static int comp_disconnect_channel(struct most_interface *iface,
 		return -ENOENT;
 	}
 
-	v4l2_info(&mdev->v4l2_dev, "comp_disconnect_channel()\n");
+	v4l2_info(&mdev->v4l2_dev, "%s()\n", __func__);
 
 	spin_lock_irq(&list_lock);
 	list_del(&mdev->list);
-- 
2.17.0

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: most: video: use __func__ instead of function name
  2018-05-03 10:21 [PATCH] staging: most: video: use __func__ instead of function name Abdun Nihaal
@ 2018-05-07  1:54 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2018-05-07  1:54 UTC (permalink / raw)
  To: Abdun Nihaal; +Cc: devel, linux-kernel

On Thu, May 03, 2018 at 03:51:05PM +0530, Abdun Nihaal wrote:
> This fixes the following checkpatch warning in video.c:
> 
> WARNING: Prefer using '\"%s...\", __func__' to using function's name
> in a string
> 
> Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
> ---
>  drivers/staging/most/video/video.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
> index 9d7e747519d9..c85e289275a9 100644
> --- a/drivers/staging/most/video/video.c
> +++ b/drivers/staging/most/video/video.c
> @@ -73,7 +73,7 @@ static int comp_vdev_open(struct file *filp)
>  	struct most_video_dev *mdev = video_drvdata(filp);
>  	struct comp_fh *fh;
>  
> -	v4l2_info(&mdev->v4l2_dev, "comp_vdev_open()\n");
> +	v4l2_info(&mdev->v4l2_dev, "%s()\n", __func__);

All of these should just be deleted.  It's debugging code and if someone
needs/wants to see tracing, they can use ftrace.

Please just drop them all.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-07  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 10:21 [PATCH] staging: most: video: use __func__ instead of function name Abdun Nihaal
2018-05-07  1:54 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.