[PATCH 4/4] xf86drm: Unconditionally clear ioctl structs

Emil Velikov emil.l.velikov at gmail.com
Wed Feb 11 05:20:57 PST 2015


On 11 February 2015 at 11:42, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> We really have to do this to avoid surprises when extending the ABI
> later on. Especially when growing the structures.
>
> A bit overkill to update all the old legacy ioctl wrappers, but can't
> hurt really either.
>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  xf86drm.c | 112 ++++++++++++++++++++++++++++++++++++++++++--------------------
>  1 file changed, 77 insertions(+), 35 deletions(-)
>
> diff --git a/xf86drm.c b/xf86drm.c
> index 263d6835c29a..a2e24eb5f76c 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
[snip]
> @@ -2383,12 +2426,11 @@ int drmSetInterfaceVersion(int fd, drmSetVersion *version)
>   */
>  int drmCommandNone(int fd, unsigned long drmCommandIndex)
>  {
> -    void *data = NULL; /* dummy */
>      unsigned long request;
>
>      request = DRM_IO( DRM_COMMAND_BASE + drmCommandIndex);
>
> -    if (drmIoctl(fd, request, data)) {
> +    if (drmIoctl(fd, request, NULL)) {
>         return -errno;
>      }
>      return 0;
> @@ -2543,12 +2585,12 @@ void drmCloseOnce(int fd)
>
>  int drmSetMaster(int fd)
>  {
> -       return drmIoctl(fd, DRM_IOCTL_SET_MASTER, 0);
> +       return drmIoctl(fd, DRM_IOCTL_SET_MASTER, NULL);
>  }
>
>  int drmDropMaster(int fd)
>  {
> -       return drmIoctl(fd, DRM_IOCTL_DROP_MASTER, 0);
> +       return drmIoctl(fd, DRM_IOCTL_DROP_MASTER, NULL);
>  }
>
These hunks are not strictly related, and maybe we can split it out.

Either way the series looks good.
Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>


More information about the dri-devel mailing list