Thread (6 messages) flat view 6 messages, 4 authors, 2013-08-01
STALE4804d

[patch -next] fb: fix recent breakage in correct_chipset()

From: Dan Carpenter <hidden>
Date: 2013-07-02 06:28:21
Also in: kernel-janitors
Subsystem: framebuffer layer, the rest · Maintainers: Helge Deller, Linus Torvalds

The 6e36308a6f "fb: fix atyfb build warning" isn't right.  It makes all
the indexes off by one.  This patch reverts it and casts the
ARRAY_SIZE() to int to silence the build warning.

Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index a89c15d..9b0f12c 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -435,8 +435,8 @@ static int correct_chipset(struct atyfb_par *par)
 	const char *name;
 	int i;
 
-	for (i = ARRAY_SIZE(aty_chips); i > 0; i--)
-		if (par->pci_id = aty_chips[i - 1].pci_id)
+	for (i = (int)ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
+		if (par->pci_id = aty_chips[i].pci_id)
 			break;
 
 	if (i < 0)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help