Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <dan.carpenter@oracle.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

authored by

Dan Carpenter and committed by
Tomi Valkeinen
8b00e183 6d3488a5

+2 -2
+2 -2
drivers/video/aty/atyfb_base.c
··· 435 435 const char *name; 436 436 int i; 437 437 438 - for (i = ARRAY_SIZE(aty_chips); i > 0; i--) 439 - if (par->pci_id == aty_chips[i - 1].pci_id) 438 + for (i = (int)ARRAY_SIZE(aty_chips) - 1; i >= 0; i--) 439 + if (par->pci_id == aty_chips[i].pci_id) 440 440 break; 441 441 442 442 if (i < 0)