drm/msm: Remove DRM_MSM_NUM_IOCTLS
authorJordan Crouse <jcrouse@codeaurora.org>
Mon, 8 May 2017 20:34:59 +0000 (14:34 -0600)
committerRob Clark <robdclark@gmail.com>
Fri, 16 Jun 2017 15:15:46 +0000 (11:15 -0400)
The ioctl array is sparsely populated but the compiler will make sure
that it is sufficiently sized for all the values that we have so we
can safely use ARRAY_SIZE() instead of having a constantly changing
#define in the uapi header.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/msm_drv.c
include/uapi/drm/msm_drm.h

index 9d498eb81906220705d85c57260cd4b1f82fa1fc..18d02ccb6c9bc57e9025fff3591c9f9008faaf83 100644 (file)
@@ -842,7 +842,7 @@ static struct drm_driver msm_driver = {
        .debugfs_init       = msm_debugfs_init,
 #endif
        .ioctls             = msm_ioctls,
-       .num_ioctls         = DRM_MSM_NUM_IOCTLS,
+       .num_ioctls         = ARRAY_SIZE(msm_ioctls),
        .fops               = &fops,
        .name               = "msm",
        .desc               = "MSM Snapdragon DRM",
index a4a189a240d71885093fd39cf43dccc2676ac9ff..a9985fe6efcd8b893e05e121049e9b8ee975d3b8 100644 (file)
@@ -261,7 +261,6 @@ struct drm_msm_gem_madvise {
 #define DRM_MSM_GEM_SUBMIT             0x06
 #define DRM_MSM_WAIT_FENCE             0x07
 #define DRM_MSM_GEM_MADVISE            0x08
-#define DRM_MSM_NUM_IOCTLS             0x09
 
 #define DRM_IOCTL_MSM_GET_PARAM        DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
 #define DRM_IOCTL_MSM_GEM_NEW          DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)