Skip to contentSkip to conversation

fb: fix atyfb build warning

PATCH In review Randy Dunlap 1 participant 1 message Jun 20, 2013 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 fb: fix atyfb build warning

From: Randy Dunlap <[email protected]>

Fix build warning when neither of CONFIG_FB_ATY_GX or CONFIG_FB_ATY_CT is enabled, since ARRAY_SIZE(aty_chips) is 0 in that case.

drivers/video/aty/atyfb_base.c:437:11: warning: overflow in implicit constant conversion [-Woverflow]

Cc Paul Mackerras <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Jean-Christophe Plagniol-Villard <[email protected]>
Cc Tomi Valkeinen <[email protected]>
---
 drivers/video/aty/atyfb_base.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/aty/atyfb_base.c +2 -2
@@ -434,8 +434,8 @@ static int correct_chipset(struct atyfb_
 	const char *name;
 	int i;
 
-	for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
-		if (par->pci_id = aty_chips[i].pci_id)
+	for (i = ARRAY_SIZE(aty_chips); i > 0; i--)
+		if (par->pci_id = aty_chips[i - 1].pci_id)
 			break;
 
 	if (i < 0)