Skip to contentSkip to conversation

drm/i915/tv: fix open-coded ARRAY_SIZE.

PATCH Applied Dave Airlie 3 participants 4 messages Apr 20, 2012

Subsystems (4)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/2 drm/i915/tv: fix open-coded ARRAY_SIZE.

From: Dave Airlie <[email protected]>

---
 drivers/gpu/drm/i915/intel_tv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_tv.c +1 -1
index ca12c70..67f444d 100644
@@ -811,7 +811,7 @@ intel_tv_mode_lookup(const 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))
Signature · 1 line
1.7.7.6
author maintainer
#1 lore raw

PATCH 2/2 drm/nouveau: fix open-coded ARRAY_SIZE in volt code

From: Dave Airlie <[email protected]>

---
 drivers/gpu/drm/nouveau/nouveau_volt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/nouveau/nouveau_volt.c +1 -1
index b010cb9..fdc8f77 100644
@@ -29,7 +29,7 @@
 #include "nouveau_gpio.h"
 
 static const enum dcb_gpio_tag vidtag[] = { 0x04, 0x05, 0x06, 0x1a, 0x73 };
-static int nr_vidtag = sizeof(vidtag) / sizeof(vidtag[0]);
+static int nr_vidtag = ARRAY_SIZE(vidtag);
 
 int
 nouveau_voltage_gpio_get(struct drm_device *dev)
Signature · 1 line
1.7.7.6