[PATCH 4/8] drivers/gpu/drm/i915: use ARRAY_SIZE macro in intel_tv.c

Nikitas Angelinas nikitasangelinas at gmail.com
Wed Sep 8 14:17:57 PDT 2010


Replace sizeof(tv_modes) / sizeof (tv_modes[0]) with
ARRAY_SIZE(tv_modes) in drivers/gpu/drm/i915/intel_tv.c

Signed-off-by: Nikitas Angelinas <nikitasangelinas at gmail.com>
---
 drivers/gpu/drm/i915/intel_tv.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index d2029ef..6dc19f6 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -30,6 +30,7 @@
  * Integrated TV-out support for the 915GM and 945GM.
  */
 
+#include <linux/kernel.h>
 #include "drmP.h"
 #include "drm.h"
 #include "drm_crtc.h"
@@ -926,7 +927,7 @@ intel_tv_mode_lookup (char *tv_format)
 {
 	int i;
 
-	for (i = 0; i < sizeof(tv_modes) / sizeof (tv_modes[0]); i++) {
+	for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
 		const struct tv_mode *tv_mode = &tv_modes[i];
 
 		if (!strcmp(tv_format, tv_mode->name))
-- 
1.7.2.3



More information about the dri-devel mailing list