Re: [PATCH] staging: most: replace function name to __func__

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 16, 2018 at 04:49:01PM +0000, Sidong Yang wrote:
> Fix checkpatch.pl warning message about logging code. Previous code
> contains hard coded function name. Fix this code by using __func__
> macro.
> 
> Signed-off-by: Sidong Yang <realwakka@xxxxxxxxx>
> ---
>  drivers/staging/most/dim2/dim2.c   |  2 +-
>  drivers/staging/most/video/video.c | 24 ++++++++++++------------
>  2 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c
> index 21e3fb48bdb4..f9bc7dea75b8 100644
> --- a/drivers/staging/most/dim2/dim2.c
> +++ b/drivers/staging/most/dim2/dim2.c
> @@ -151,7 +151,7 @@ void dimcb_io_write(u32 __iomem *ptr32, u32 value)
>   */
>  void dimcb_on_error(u8 error_id, const char *error_message)
>  {
> -	pr_err("dimcb_on_error: error_id - %d, error_message - %s\n", error_id,
> +	pr_err("%s: error_id - %d, error_message - %s\n", __func__, error_id,
>  	       error_message);

This is fine, but:

>  }
>  
> diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
> index 098873851646..22d9b1fc622f 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__);

That should just be dropped entirely, right?  It's tracing code, and if
you really want to do that, just use ftrace instead.

So just remove these types of call that just has the function name.

thanks,

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



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux