From: Dan Carpenter Date: Tue, 2 Jul 2013 06:28:21 +0000 (+0300) Subject: fbdev/atyfb: fix recent breakage in correct_chipset() X-Git-Tag: v3.11-rc4~19^2~1 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=8b00e1831cea899cd4dfe04e574c26e376c27368;p=~emulex%2Finfiniband.git fbdev/atyfb: fix recent breakage in correct_chipset() 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 Acked-by: Randy Dunlap Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index a89c15de9f4..9b0f12c5c28 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)