On 10/10/25 01:25, Sunday Adelodun wrote:
The function `drm_ioctl_flags()` defined in `drm_ioctl.c` shares the same
identifier name as the `enum drm_ioctl_flags` defined in
`drm_ioctl.h`. Although this naming overlap is perfectly valid in C —
since functions and enumerations exist in separate namespaces and do
not affect compilation or linkage — it causes a symbol collision in the
kernel-doc build system.
During `make htmldocs`, Sphinx reports the following warning:
./Documentation/gpu/drm-uapi:574: ./drivers/gpu/drm/drm_ioctl.c:915:
WARNING: Duplicate C declaration, also defined at gpu/drm-uapi:69.
Declaration is '.. c:function::
bool drm_ioctl_flags (unsigned int nr, unsigned int *flags)'.
This happens because kernel-doc processes both identifiers (the enum and
the function) under the same name, leading to a duplicate symbol entry
in the generated documentation index. The build system therefore treats
them as conflicting declarations, even though they represent different
entities in code.
To resolve this, the function has been renamed to
`drm_ioctl_get_flags()`, which both removes the naming collision and
better describes the function’s purpose—retrieving ioctl permission
flags associated with a given command number.
All affected references have been updated accordingly in:
- `drivers/gpu/drm/drm_ioctl.c`
- `drivers/gpu/drm/vmwgfx/vmwgfx_drv.c`
- `include/drm/drm_ioctl.h`
No other symbols or behavior are modified.
Signed-off-by: Sunday Adelodun <[email protected]>
---
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 f593dc569d31..313e8bb7986a 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -912,7 +912,7 @@ long drm_ioctl(struct file *filp,
EXPORT_SYMBOL(drm_ioctl);
/**
- * drm_ioctl_flags - Check for core ioctl and return ioctl permission flags
+ * drm_ioctl_get_flags - Check for core ioctl and return ioctl permission flags
* @nr: ioctl number
* @flags: where to return the ioctl permission flags
*
@@ -923,7 +923,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_ioctl_get_flags(unsigned int nr, unsigned int *flags)
{
if (nr >= DRM_COMMAND_BASE && nr < DRM_COMMAND_END)
return false;
@@ -935,4 +935,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_ioctl_get_flags);
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 8ff958d119be..fa4644067d46 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -1257,7 +1257,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_ioctl_get_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 171760b6c4a1..585dda7550b0 100644
--- a/include/drm/drm_ioctl.h
+++ b/include/drm/drm_ioctl.h
@@ -164,7 +164,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_ioctl_get_flags(unsigned int nr, unsigned int *flags);
int drm_noop(struct drm_device *dev, void *data,
struct drm_file *file_priv);
Hi all,
Just a gentle ping on this patch,
please let me know if there’s any feedback or further changes needed.
Thanks,
Sunday