]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fbdev/atyfb: fix recent breakage in correct_chipset()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 2 Jul 2013 06:28:21 +0000 (09:28 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 29 Jul 2013 08:24:41 +0000 (11:24 +0300)
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>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/aty/atyfb_base.c

index a89c15de9f45c885f3dc7fe76bad22bde184013d..9b0f12c5c2842f783501821d7c6bb4a9527f936f 100644 (file)
@@ -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)