2020-11-19 07:31:58

by 赵军奎

[permalink] [raw]
Subject: [PATCH] via/via_irq: use __func__ to replace string function name

This change also fix checkpatch.pl warning:
WARNING: Prefer using '"%s...", __func__' to using
'via_driver_irq_postinstall', this function's name, in a string
+ DRM_DEBUG("via_driver_irq_postinstall\n");

Signed-off-by: Bernard Zhao <[email protected]>
---
drivers/gpu/drm/via/via_irq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
index 24cc445169e2..56ce5d4ee24a 100644
--- a/drivers/gpu/drm/via/via_irq.c
+++ b/drivers/gpu/drm/via/via_irq.c
@@ -308,7 +308,7 @@ int via_driver_irq_postinstall(struct drm_device *dev)
drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
u32 status;

- DRM_DEBUG("via_driver_irq_postinstall\n");
+ DRM_DEBUG("fun: %s\n", __func__);
if (!dev_priv)
return -EINVAL;

--
2.29.0


2020-11-24 00:39:54

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH] via/via_irq: use __func__ to replace string function name

Hi Bernard.

On Wed, Nov 18, 2020 at 11:29:55PM -0800, Bernard Zhao wrote:
> This change also fix checkpatch.pl warning:
> WARNING: Prefer using '"%s...", __func__' to using
> 'via_driver_irq_postinstall', this function's name, in a string
> + DRM_DEBUG("via_driver_irq_postinstall\n");
>
> Signed-off-by: Bernard Zhao <[email protected]>
> ---
> drivers/gpu/drm/via/via_irq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
> index 24cc445169e2..56ce5d4ee24a 100644
> --- a/drivers/gpu/drm/via/via_irq.c
> +++ b/drivers/gpu/drm/via/via_irq.c
> @@ -308,7 +308,7 @@ int via_driver_irq_postinstall(struct drm_device *dev)
> drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
> u32 status;
>
> - DRM_DEBUG("via_driver_irq_postinstall\n");
> + DRM_DEBUG("fun: %s\n", __func__);

DRM_DEBUG() will print the name of the calling function so the use of
__func__ here is not relevant.


For this old driver we should try to limit patches to bug fixing and
infrastructure updates.

Sam