drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE()
authorDamien Lespiau <damien.lespiau@intel.com>
Mon, 9 Jun 2014 13:39:49 +0000 (14:39 +0100)
committerDave Airlie <airlied@redhat.com>
Mon, 9 Jun 2014 23:36:17 +0000 (09:36 +1000)
I cannot see a need to provide a DRM_ version of ARRAY_SIZE(), only used
in a few places. I suspect its usage has been spread by copy & paste
rather than anything else.

Let's just remove it for plain ARRAY_SIZE().

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
20 files changed:
drivers/gpu/drm/armada/armada_drv.c
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/gma500/psb_drv.c
drivers/gpu/drm/i810/i810_dma.c
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_ioc32.c
drivers/gpu/drm/mga/mga_ioc32.c
drivers/gpu/drm/mga/mga_state.c
drivers/gpu/drm/nouveau/nouveau_ioc32.c
drivers/gpu/drm/qxl/qxl_ioctl.c
drivers/gpu/drm/r128/r128_ioc32.c
drivers/gpu/drm/r128/r128_state.c
drivers/gpu/drm/radeon/radeon_ioc32.c
drivers/gpu/drm/radeon/radeon_kms.c
drivers/gpu/drm/radeon/radeon_state.c
drivers/gpu/drm/savage/savage_bci.c
drivers/gpu/drm/sis/sis_mm.c
drivers/gpu/drm/via/via_dma.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
include/drm/drmP.h

index 567cfbde0883df7f26e9b81da62ef778503dd424..8ab3cd1a8cdbdad1385a9c9042582e9fff05c855 100644 (file)
@@ -402,7 +402,7 @@ static struct platform_driver armada_drm_platform_driver = {
 
 static int __init armada_drm_init(void)
 {
-       armada_drm_driver.num_ioctls = DRM_ARRAY_SIZE(armada_ioctls);
+       armada_drm_driver.num_ioctls = ARRAY_SIZE(armada_ioctls);
        return platform_driver_register(&armada_drm_platform_driver);
 }
 module_init(armada_drm_init);
index 5d225dd58a872aed1af19fac8ee56041c4514ac5..d91f277775375050c9b8e9e63c925b4854cc3cec 100644 (file)
@@ -573,7 +573,7 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
        int ret;
 
        pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
-       exynos_drm_driver.num_ioctls = DRM_ARRAY_SIZE(exynos_ioctls);
+       exynos_drm_driver.num_ioctls = ARRAY_SIZE(exynos_ioctls);
 
 #ifdef CONFIG_DRM_EXYNOS_FIMD
        ret = platform_driver_register(&fimd_driver);
index 59ea45e5c97edb90ae32948ccf4221a6de7a3163..6e8fe9ec02b596595e975d9472095684d70e44dd 100644 (file)
@@ -477,7 +477,7 @@ static struct drm_driver driver = {
        .lastclose = psb_driver_lastclose,
        .preclose = psb_driver_preclose,
 
-       .num_ioctls = DRM_ARRAY_SIZE(psb_ioctls),
+       .num_ioctls = ARRAY_SIZE(psb_ioctls),
        .device_is_agp = psb_driver_device_is_agp,
        .irq_preinstall = psb_irq_preinstall,
        .irq_postinstall = psb_irq_postinstall,
index aeace37415aac8ae62ab2aa53a3b927ae648fb6c..e88bac1d781f7b5a34051d0fcb138f2efc11dc0d 100644 (file)
@@ -1251,7 +1251,7 @@ const struct drm_ioctl_desc i810_ioctls[] = {
        DRM_IOCTL_DEF_DRV(I810_FLIP, i810_flip_bufs, DRM_AUTH|DRM_UNLOCKED),
 };
 
-int i810_max_ioctl = DRM_ARRAY_SIZE(i810_ioctls);
+int i810_max_ioctl = ARRAY_SIZE(i810_ioctls);
 
 /**
  * Determine if the device really is AGP or not.
index b9159ade5e85294abe86c61808da82dd7f84a2bb..4c22a5b7f4c532688ef513c716c9f0849d9fcb46 100644 (file)
@@ -1986,7 +1986,7 @@ const struct drm_ioctl_desc i915_ioctls[] = {
        DRM_IOCTL_DEF_DRV(I915_GEM_USERPTR, i915_gem_userptr_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
 };
 
-int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls);
+int i915_max_ioctl = ARRAY_SIZE(i915_ioctls);
 
 /*
  * This is really ugly: Because old userspace abused the linux agp interface to
index 3c59584161c2dab0f0476b013c27a1248ec7189e..2e0613e262515f7d2ad6f8b75c4f0884bdf05333 100644 (file)
@@ -208,7 +208,7 @@ long i915_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        if (nr < DRM_COMMAND_BASE)
                return drm_compat_ioctl(filp, cmd, arg);
 
-       if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(i915_compat_ioctls))
+       if (nr < DRM_COMMAND_BASE + ARRAY_SIZE(i915_compat_ioctls))
                fn = i915_compat_ioctls[nr - DRM_COMMAND_BASE];
 
        if (fn != NULL)
index 86b4bb80485200e1067c47574117fa1c46c17b8f..729bfd56b55f49d9bd71a501f6717659a2f47af1 100644 (file)
@@ -214,7 +214,7 @@ long mga_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        if (nr < DRM_COMMAND_BASE)
                return drm_compat_ioctl(filp, cmd, arg);
 
-       if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(mga_compat_ioctls))
+       if (nr < DRM_COMMAND_BASE + ARRAY_SIZE(mga_compat_ioctls))
                fn = mga_compat_ioctls[nr - DRM_COMMAND_BASE];
 
        if (fn != NULL)
index 3cb58df5237e687299978476b479da827b3decc7..792f924496fc8cecd9fb7e16f8e2d58973476885 100644 (file)
@@ -1099,4 +1099,4 @@ const struct drm_ioctl_desc mga_ioctls[] = {
        DRM_IOCTL_DEF_DRV(MGA_DMA_BOOTSTRAP, mga_dma_bootstrap, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
 };
 
-int mga_max_ioctl = DRM_ARRAY_SIZE(mga_ioctls);
+int mga_max_ioctl = ARRAY_SIZE(mga_ioctls);
index c1a7e5a73a26b0c98886d3583400507b4fc65866..462679a8fec5783735a5cabd61058a79e212999c 100644 (file)
@@ -57,7 +57,7 @@ long nouveau_compat_ioctl(struct file *filp, unsigned int cmd,
                return drm_compat_ioctl(filp, cmd, arg);
 
 #if 0
-       if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(mga_compat_ioctls))
+       if (nr < DRM_COMMAND_BASE + ARRAY_SIZE(mga_compat_ioctls))
                fn = nouveau_compat_ioctls[nr - DRM_COMMAND_BASE];
 #endif
        if (fn != NULL)
index 0bb86e6d41b44cc4c1641e72da6e67e754994798..b110883f8253dc272498abb64b4c408146519930 100644 (file)
@@ -451,4 +451,4 @@ const struct drm_ioctl_desc qxl_ioctls[] = {
                          DRM_AUTH|DRM_UNLOCKED),
 };
 
-int qxl_max_ioctls = DRM_ARRAY_SIZE(qxl_ioctls);
+int qxl_max_ioctls = ARRAY_SIZE(qxl_ioctls);
index b0d0fd3e437676cb306a55df7fa82cba49bcdda1..663f38c63ba6bd334d4732de3e80cdbf89ae711b 100644 (file)
@@ -203,7 +203,7 @@ long r128_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        if (nr < DRM_COMMAND_BASE)
                return drm_compat_ioctl(filp, cmd, arg);
 
-       if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(r128_compat_ioctls))
+       if (nr < DRM_COMMAND_BASE + ARRAY_SIZE(r128_compat_ioctls))
                fn = r128_compat_ioctls[nr - DRM_COMMAND_BASE];
 
        if (fn != NULL)
index 97064dd434c28f0eb31882aa70ed6ead35176f8c..575e986f82a76239113e2e122b42ce961a24e3e0 100644 (file)
@@ -1641,4 +1641,4 @@ const struct drm_ioctl_desc r128_ioctls[] = {
        DRM_IOCTL_DEF_DRV(R128_GETPARAM, r128_getparam, DRM_AUTH),
 };
 
-int r128_max_ioctl = DRM_ARRAY_SIZE(r128_ioctls);
+int r128_max_ioctl = ARRAY_SIZE(r128_ioctls);
index bdb0f93e73bcfddcea63d1f8e284af05da742e91..0b98ea1345792986fa064f878e40aaa13388c7de 100644 (file)
@@ -399,7 +399,7 @@ long radeon_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        if (nr < DRM_COMMAND_BASE)
                return drm_compat_ioctl(filp, cmd, arg);
 
-       if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(radeon_compat_ioctls))
+       if (nr < DRM_COMMAND_BASE + ARRAY_SIZE(radeon_compat_ioctls))
                fn = radeon_compat_ioctls[nr - DRM_COMMAND_BASE];
 
        if (fn != NULL)
index eaaedba0467595aaced591c6d70666c75ac97211..f0717373a508a49ec2f741a8489d301218796e65 100644 (file)
@@ -859,4 +859,4 @@ const struct drm_ioctl_desc radeon_ioctls_kms[] = {
        DRM_IOCTL_DEF_DRV(RADEON_GEM_VA, radeon_gem_va_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF_DRV(RADEON_GEM_OP, radeon_gem_op_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
 };
-int radeon_max_kms_ioctl = DRM_ARRAY_SIZE(radeon_ioctls_kms);
+int radeon_max_kms_ioctl = ARRAY_SIZE(radeon_ioctls_kms);
index b576549fc7837971caeeeb0cdcbba706fcebd73e..23bb64fd775f674cae5091013b4d63979f62ebeb 100644 (file)
@@ -3258,4 +3258,4 @@ struct drm_ioctl_desc radeon_ioctls[] = {
        DRM_IOCTL_DEF_DRV(RADEON_CS, r600_cs_legacy_ioctl, DRM_AUTH)
 };
 
-int radeon_max_ioctl = DRM_ARRAY_SIZE(radeon_ioctls);
+int radeon_max_ioctl = ARRAY_SIZE(radeon_ioctls);
index d2b2df9e26f3692b51d7495b5197b66ad9d6387b..c97cdc9ab2397696456b5caa58615499e8e67b96 100644 (file)
@@ -1079,4 +1079,4 @@ const struct drm_ioctl_desc savage_ioctls[] = {
        DRM_IOCTL_DEF_DRV(SAVAGE_BCI_EVENT_WAIT, savage_bci_event_wait, DRM_AUTH),
 };
 
-int savage_max_ioctl = DRM_ARRAY_SIZE(savage_ioctls);
+int savage_max_ioctl = ARRAY_SIZE(savage_ioctls);
index 0573be0d293304269f6cd11eb8677002ddf217a6..77f288e4a0a63a1ec558e376138230cfed2be7fb 100644 (file)
@@ -359,4 +359,4 @@ const struct drm_ioctl_desc sis_ioctls[] = {
        DRM_IOCTL_DEF_DRV(SIS_FB_INIT, sis_fb_init, DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY),
 };
 
-int sis_max_ioctl = DRM_ARRAY_SIZE(sis_ioctls);
+int sis_max_ioctl = ARRAY_SIZE(sis_ioctls);
index a18479c6b6dae3dfdbb3d3e6e238f129dc79a3ad..6fc0648dd37f6644c62968ae05d3209edbf5b6fd 100644 (file)
@@ -737,4 +737,4 @@ const struct drm_ioctl_desc via_ioctls[] = {
        DRM_IOCTL_DEF_DRV(VIA_BLIT_SYNC, via_dma_blit_sync, DRM_AUTH)
 };
 
-int via_max_ioctl = DRM_ARRAY_SIZE(via_ioctls);
+int via_max_ioctl = ARRAY_SIZE(via_ioctls);
index 6bdd15eea7e85ed098198ea98474213dced5c254..246a62bab378d1838e5dd60cb39fa796ff0d7497 100644 (file)
@@ -1417,7 +1417,7 @@ static struct drm_driver driver = {
        .enable_vblank = vmw_enable_vblank,
        .disable_vblank = vmw_disable_vblank,
        .ioctls = vmw_ioctls,
-       .num_ioctls = DRM_ARRAY_SIZE(vmw_ioctls),
+       .num_ioctls = ARRAY_SIZE(vmw_ioctls),
        .master_create = vmw_master_create,
        .master_destroy = vmw_master_destroy,
        .master_set = vmw_master_set,
index 83222db41566c0b9415e7191dce47de05ae432fe..8af71a8e2c0056ba5edb627061910aa0661fcc99 100644 (file)
@@ -234,8 +234,6 @@ int drm_err(const char *func, const char *format, ...);
 /** \name Internal types and structures */
 /*@{*/
 
-#define DRM_ARRAY_SIZE(x) ARRAY_SIZE(x)
-
 #define DRM_IF_VERSION(maj, min) (maj << 16 | min)
 
 /**