[PATCH] Remove DRM_ARRAY_SIZE

From: Michael Veeck <michael.veeck@gmx.net>

drivers/char/drm/drmP.h defines a macro DRM_ARRAY_SIZE(x) for
determining the size of an array. kernel.h already provides one

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

Index: linux-kj/drivers/char/drm/drmP.h
===================================================================
--- linux-kj.orig/drivers/char/drm/drmP.h	2005-09-03 14:19:45.000000000 +0400
+++ linux-kj/drivers/char/drm/drmP.h	2005-09-03 14:34:20.000000000 +0400
@@ -228,7 +228,6 @@
 /** \name Internal types and structures */
 /*@{*/
 
-#define DRM_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
 #define DRM_MIN(a,b) ((a)<(b)?(a):(b))
 #define DRM_MAX(a,b) ((a)>(b)?(a):(b))
 
Index: linux-kj/drivers/char/drm/drm_drv.c
===================================================================
--- linux-kj.orig/drivers/char/drm/drm_drv.c	2005-09-03 14:19:44.000000000 +0400
+++ linux-kj/drivers/char/drm/drm_drv.c	2005-09-03 14:34:20.000000000 +0400
@@ -15,7 +15,7 @@
  * #define DRIVER_DESC		"Matrox G200/G400"
  * #define DRIVER_DATE		"20001127"
  *
- * #define DRIVER_IOCTL_COUNT	DRM_ARRAY_SIZE( mga_ioctls )
+ * #define DRIVER_IOCTL_COUNT	ARRAY_SIZE( mga_ioctls )
  *
  * #define drm_x		mga_##x
  * \endcode
@@ -118,7 +118,7 @@ static drm_ioctl_desc_t		  drm_ioctls[] 
 	[DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK)]   = { drm_wait_vblank, 0, 0 },
 };
 
-#define DRIVER_IOCTL_COUNT	DRM_ARRAY_SIZE( drm_ioctls )
+#define DRIVER_IOCTL_COUNT	ARRAY_SIZE( drm_ioctls )
 
 /**
  * Take down the DRM device.
Index: linux-kj/drivers/char/drm/drm_fops.c
===================================================================
--- linux-kj.orig/drivers/char/drm/drm_fops.c	2005-09-03 14:19:45.000000000 +0400
+++ linux-kj/drivers/char/drm/drm_fops.c	2005-09-03 14:34:20.000000000 +0400
@@ -63,7 +63,7 @@ static int drm_setup( drm_device_t *dev 
 			return i;
 	}
 
-	for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ )
+	for ( i = 0 ; i < ARRAY_SIZE(dev->counts) ; i++ )
 		atomic_set( &dev->counts[i], 0 );
 
 	for ( i = 0 ; i < DRM_HASH_SIZE ; i++ ) {
Index: linux-kj/drivers/char/drm/mga_state.c
===================================================================
--- linux-kj.orig/drivers/char/drm/mga_state.c	2005-09-03 14:19:45.000000000 +0400
+++ linux-kj/drivers/char/drm/mga_state.c	2005-09-03 14:34:20.000000000 +0400
@@ -1186,4 +1186,4 @@ drm_ioctl_desc_t mga_ioctls[] = {
 
 };
 
-int mga_max_ioctl = DRM_ARRAY_SIZE(mga_ioctls);
+int mga_max_ioctl = ARRAY_SIZE(mga_ioctls);
Index: linux-kj/drivers/char/drm/r128_state.c
===================================================================
--- linux-kj.orig/drivers/char/drm/r128_state.c	2005-09-03 14:19:44.000000000 +0400
+++ linux-kj/drivers/char/drm/r128_state.c	2005-09-03 14:34:20.000000000 +0400
@@ -1733,4 +1733,4 @@ drm_ioctl_desc_t r128_ioctls[] = {
 	[DRM_IOCTL_NR(DRM_R128_GETPARAM)]   = { r128_getparam, 1, 0 },
 };
 
-int r128_max_ioctl = DRM_ARRAY_SIZE(r128_ioctls);
+int r128_max_ioctl = ARRAY_SIZE(r128_ioctls);
Index: linux-kj/drivers/char/drm/radeon_state.c
===================================================================
--- linux-kj.orig/drivers/char/drm/radeon_state.c	2005-09-03 14:19:44.000000000 +0400
+++ linux-kj/drivers/char/drm/radeon_state.c	2005-09-03 14:34:20.000000000 +0400
@@ -3104,4 +3104,4 @@ drm_ioctl_desc_t radeon_ioctls[] = {
 	[DRM_IOCTL_NR(DRM_RADEON_SURF_FREE)]  = { radeon_surface_free, 1, 0 }
 };
 
-int radeon_max_ioctl = DRM_ARRAY_SIZE(radeon_ioctls);
+int radeon_max_ioctl = ARRAY_SIZE(radeon_ioctls);
Index: linux-kj/drivers/char/drm/sis_mm.c
===================================================================
--- linux-kj.orig/drivers/char/drm/sis_mm.c	2005-09-03 14:19:44.000000000 +0400
+++ linux-kj/drivers/char/drm/sis_mm.c	2005-09-03 14:34:20.000000000 +0400
@@ -413,5 +413,5 @@ drm_ioctl_desc_t sis_ioctls[] = {
 	[DRM_IOCTL_NR(DRM_SIS_FB_INIT)]   = { sis_fb_init,         1, 1 }
 };
 
-int sis_max_ioctl = DRM_ARRAY_SIZE(sis_ioctls);
+int sis_max_ioctl = ARRAY_SIZE(sis_ioctls);
 
Index: linux-kj/drivers/char/drm/via_drv.c
===================================================================
--- linux-kj.orig/drivers/char/drm/via_drv.c	2005-09-03 14:19:45.000000000 +0400
+++ linux-kj/drivers/char/drm/via_drv.c	2005-09-03 14:34:20.000000000 +0400
@@ -91,7 +91,7 @@ static struct drm_driver driver = {
 	.postinit = postinit,
 	.version = version,
 	.ioctls = ioctls,
-	.num_ioctls = DRM_ARRAY_SIZE(ioctls),
+	.num_ioctls = ARRAY_SIZE(ioctls),
 	.fops = {
 		.owner = THIS_MODULE,
 		.open = drm_open,
Index: linux-kj/drivers/char/drm/i810_dma.c
===================================================================
--- linux-kj.orig/drivers/char/drm/i810_dma.c	2005-09-03 14:19:45.000000000 +0400
+++ linux-kj/drivers/char/drm/i810_dma.c	2005-09-03 14:34:20.000000000 +0400
@@ -1378,7 +1378,7 @@ drm_ioctl_desc_t i810_ioctls[] = {
 	[DRM_IOCTL_NR(DRM_I810_FLIP)]    = { i810_flip_bufs,   1, 0 }
 };
 
-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: linux-kj/drivers/char/drm/i830_dma.c
===================================================================
--- linux-kj.orig/drivers/char/drm/i830_dma.c	2005-09-03 14:19:45.000000000 +0400
+++ linux-kj/drivers/char/drm/i830_dma.c	2005-09-03 14:34:20.000000000 +0400
@@ -1581,7 +1581,7 @@ drm_ioctl_desc_t i830_ioctls[] = {
 	[DRM_IOCTL_NR(DRM_I830_SETPARAM)] = { i830_setparam,    1, 0 } 
 };
 
-int i830_max_ioctl = DRM_ARRAY_SIZE(i830_ioctls);
+int i830_max_ioctl = ARRAY_SIZE(i830_ioctls);
 
 /**
  * Determine if the device really is AGP or not.
