mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm: Rename drm_ioctl_flags() to eliminate duplicate declaration warning
@ 2023-09-06 16:45 Juntong Deng
  2023-09-06 21:13 ` Zack Rusin
  0 siblings, 1 reply; 3+ messages in thread
From: Juntong Deng @ 2023-09-06 16:45 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, tzimmermann, airlied, daniel, zackr,
	linux-graphics-maintainer
  Cc: dri-devel, linux-kernel, linux-kernel-mentees

There are 'enum drm_ioctl_flags' and 'bool drm_ioctl_flags(...)' with the
same name, which is not a problem in C, but it can lead to
'WARNING: Duplicate C declaration' when generating documentation.

According to the purpose of the function, rename 'drm_ioctl_flags(...)' to
'drm_check_ioctl_flags(...)' to eliminate the warning.

Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
---
 drivers/gpu/drm/drm_ioctl.c         | 6 +++---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +-
 include/drm/drm_ioctl.h             | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index f03ffbacfe9b..30699a0a10bc 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -911,7 +911,7 @@ long drm_ioctl(struct file *filp,
 EXPORT_SYMBOL(drm_ioctl);
 
 /**
- * drm_ioctl_flags - Check for core ioctl and return ioctl permission flags
+ * drm_check_ioctl_flags - Check for core ioctl and return ioctl permission flags
  * @nr: ioctl number
  * @flags: where to return the ioctl permission flags
  *
@@ -922,7 +922,7 @@ EXPORT_SYMBOL(drm_ioctl);
  * Returns:
  * True if the @nr corresponds to a DRM core ioctl number, false otherwise.
  */
-bool drm_ioctl_flags(unsigned int nr, unsigned int *flags)
+bool drm_check_ioctl_flags(unsigned int nr, unsigned int *flags)
 {
 	if (nr >= DRM_COMMAND_BASE && nr < DRM_COMMAND_END)
 		return false;
@@ -934,4 +934,4 @@ bool drm_ioctl_flags(unsigned int nr, unsigned int *flags)
 	*flags = drm_ioctls[nr].flags;
 	return true;
 }
-EXPORT_SYMBOL(drm_ioctl_flags);
+EXPORT_SYMBOL(drm_check_ioctl_flags);
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 8b24ecf60e3e..9615104451b3 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -1287,7 +1287,7 @@ static long vmw_generic_ioctl(struct file *filp, unsigned int cmd,
 			goto out_io_encoding;
 
 		flags = ioctl->flags;
-	} else if (!drm_ioctl_flags(nr, &flags))
+	} else if (!drm_check_ioctl_flags(nr, &flags))
 		return -EINVAL;
 
 	return ioctl_func(filp, cmd, arg);
diff --git a/include/drm/drm_ioctl.h b/include/drm/drm_ioctl.h
index 6ed61c371f6c..2fc5fc86f711 100644
--- a/include/drm/drm_ioctl.h
+++ b/include/drm/drm_ioctl.h
@@ -175,7 +175,7 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
 /* Let drm_compat_ioctl be assigned to .compat_ioctl unconditionally */
 #define drm_compat_ioctl NULL
 #endif
-bool drm_ioctl_flags(unsigned int nr, unsigned int *flags);
+bool drm_check_ioctl_flags(unsigned int nr, unsigned int *flags);
 
 int drm_noop(struct drm_device *dev, void *data,
 	     struct drm_file *file_priv);
-- 
2.39.2


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

* Re: [PATCH] drm: Rename drm_ioctl_flags() to eliminate duplicate declaration warning
  2023-09-06 16:45 [PATCH] drm: Rename drm_ioctl_flags() to eliminate duplicate declaration warning Juntong Deng
@ 2023-09-06 21:13 ` Zack Rusin
  2023-09-06 22:16   ` Juntong Deng
  0 siblings, 1 reply; 3+ messages in thread
From: Zack Rusin @ 2023-09-06 21:13 UTC (permalink / raw)
  To: daniel, maarten.lankhorst, mripard, juntong.deng, airlied,
	tzimmermann, Linux-graphics-maintainer
  Cc: dri-devel, linux-kernel-mentees, linux-kernel

On Thu, 2023-09-07 at 00:45 +0800, Juntong Deng wrote:
> There are 'enum drm_ioctl_flags' and 'bool drm_ioctl_flags(...)' with the
> same name, which is not a problem in C, but it can lead to
> 'WARNING: Duplicate C declaration' when generating documentation.
> 
> According to the purpose of the function, rename 'drm_ioctl_flags(...)' to
> 'drm_check_ioctl_flags(...)' to eliminate the warning.
> 
> Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
> ---
>  drivers/gpu/drm/drm_ioctl.c         | 6 +++---
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +-
>  include/drm/drm_ioctl.h             | 2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> index f03ffbacfe9b..30699a0a10bc 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -911,7 +911,7 @@ long drm_ioctl(struct file *filp,
>  EXPORT_SYMBOL(drm_ioctl);
>  
>  /**
> - * drm_ioctl_flags - Check for core ioctl and return ioctl permission flags
> + * drm_check_ioctl_flags - Check for core ioctl and return ioctl permission flags
>   * @nr: ioctl number
>   * @flags: where to return the ioctl permission flags
>   *
> @@ -922,7 +922,7 @@ EXPORT_SYMBOL(drm_ioctl);
>   * Returns:
>   * True if the @nr corresponds to a DRM core ioctl number, false otherwise.
>   */
> -bool drm_ioctl_flags(unsigned int nr, unsigned int *flags)
> +bool drm_check_ioctl_flags(unsigned int nr, unsigned int *flags)
>  {

Can we follow the namespace_action naming convention here? i.e.
drm_ioctl_flags_check instead. I find it a lot easier to look up/memorise the api if
naming is consistent.

z

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

* Re: [PATCH] drm: Rename drm_ioctl_flags() to eliminate duplicate declaration warning
  2023-09-06 21:13 ` Zack Rusin
@ 2023-09-06 22:16   ` Juntong Deng
  0 siblings, 0 replies; 3+ messages in thread
From: Juntong Deng @ 2023-09-06 22:16 UTC (permalink / raw)
  To: Zack Rusin, daniel, maarten.lankhorst, mripard, airlied,
	tzimmermann, Linux-graphics-maintainer
  Cc: dri-devel, linux-kernel-mentees, linux-kernel

On 2023/9/7 5:13, Zack Rusin wrote:
> 
> Can we follow the namespace_action naming convention here? i.e.
> drm_ioctl_flags_check instead. I find it a lot easier to look up/memorise the api if
> naming is consistent.
> 
> z

you are right!

I will send a new patch.

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

end of thread, other threads:[~2023-09-06 22:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-06 16:45 [PATCH] drm: Rename drm_ioctl_flags() to eliminate duplicate declaration warning Juntong Deng
2023-09-06 21:13 ` Zack Rusin
2023-09-06 22:16   ` Juntong Deng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®