Re: [PATCH 2/8] staging: kpc2000: use __func__ in debug messages

From: Greg KH
Date: Thu May 23 2019 - 07:58:46 EST


On Thu, May 23, 2019 at 01:36:07PM +0200, Simon Sandström wrote:
> Fixes checkpatch.pl warning "Prefer using '"%s...", __func__' to using
> '<function name>', this function's name, in a string".
>
> Signed-off-by: Simon Sandström <simon@xxxxxxxxxx>
> ---
> drivers/staging/kpc2000/kpc2000/cell_probe.c | 22 +++++++++++++-------
> 1 file changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/kpc2000/kpc2000/cell_probe.c b/drivers/staging/kpc2000/kpc2000/cell_probe.c
> index 95bfbe4aae4d..7b850f3e808b 100644
> --- a/drivers/staging/kpc2000/kpc2000/cell_probe.c
> +++ b/drivers/staging/kpc2000/kpc2000/cell_probe.c
> @@ -299,7 +299,8 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard,
>
> kudev = kzalloc(sizeof(struct kpc_uio_device), GFP_KERNEL);
> if (!kudev) {
> - dev_err(&pcard->pdev->dev, "probe_core_uio: failed to kzalloc kpc_uio_device\n");
> + dev_err(&pcard->pdev->dev, "%s: failed to kzalloc kpc_uio_device\n",
> + __func__);

kmalloc and friend error messages should just be deleted. Didn't
checkpatch say something about that?

thanks,

greg k-h