linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch -next] fb: fix recent breakage in correct_chipset()
@ 2013-07-02  6:28 Dan Carpenter
  2013-07-02 15:50 ` Randy Dunlap
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Dan Carpenter @ 2013-07-02  6:28 UTC (permalink / raw)
  To: linux-fbdev

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 <dan.carpenter@oracle.com>

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)

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-01 11:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-02  6:28 [patch -next] fb: fix recent breakage in correct_chipset() Dan Carpenter
2013-07-02 15:50 ` Randy Dunlap
2013-07-12 20:11 ` Randy Dunlap
2013-07-26  8:34 ` Tomi Valkeinen
2013-08-01  9:31 ` Geert Uytterhoeven
2013-08-01 11:50 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).