Re: [PATCH 1/6] drm: Fix DRM_IOCTL_DEF_DRV()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 27, 2015 at 03:14:10PM +0000, Emil Velikov wrote:
> Hi Ville,
> 
> On 27 March 2015 at 13:51,  <ville.syrjala@xxxxxxxxxxxxxxx> wrote:
> > From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> >
> > Currently DRM_IOCTL_DEF_DRV does '[DRM_IOCTL_NR(DRM_##ioctl)]' which
> > doesn't make much sense since DRM_##ioctl is already a the raw ioctl
> > number. So change it to 'DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE'
> > which means the DRM_IOCTL_NR() now makes sense, and also this also means
> > if there's a mistake in the DRM_IOCTL_##ioctl macros we might get a
> > warning about it (eg. we would have gotten a sparse warning about the
> > i915 colorkey get/set ioctl being defined to be the same thing).
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> > ---
> >  include/drm/drmP.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> > index 63c0b01..6195ee9b 100644
> > --- a/include/drm/drmP.h
> > +++ b/include/drm/drmP.h
> > @@ -263,7 +263,7 @@ struct drm_ioctl_desc {
> >   */
> >
> >  #define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags)                        \
> > -       [DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl}
> > +       [DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl}
> >
> Humble request: Can you split this long line to something line the
> following. It should improve the overall readability.
> Plus is will make your follow up changes clearer.
> 
> +       [DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = { \
> +             .cmd = DRM_##ioctl, \
> +             .func = _func, \
> +             .flags = _flags, \
> +             .cmd_drv = DRM_IOCTL_##ioctl, \
> +             .name = #ioctl \
> +       }

Daniel already picked these up, so my work is done ;) But feel free to
toss in a followup.

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux