* [PATCH] ATI FB driver: fix variable size warnings
@ 2010-10-19 16:53 Davidlohr Bueso
0 siblings, 0 replies; only message in thread
From: Davidlohr Bueso @ 2010-10-19 16:53 UTC (permalink / raw)
To: Paul Mackerras, grant.likely, alex.kern, benh, mpatocka; +Cc: LKML
ATI FB driver: fix variable size warnings and get rid of two unused variables.
Basically revert the order of the for-loop and get rid of the ARRAY_SIZE()-1 bit, which causes the warning. The iterations produce the exact same result: exit if the PCI id is found. Otherwise (if no device is found, then 'i' should be the same value of the size of the amount of elements in the array).
My current randconfig showed the following:
drivers/video/aty/atyfb_base.c: In function ‘correct_chipset’:
drivers/video/aty/atyfb_base.c:441: warning: overflow in implicit constant conversion
This is compile-tested only.
PS: Not sure who deals with this, so please include CC if you know.
Thanks.
Davidlohr
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
drivers/video/aty/atyfb_base.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index f8d69ad..7771142 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -436,13 +436,13 @@ static int __devinit correct_chipset(struct atyfb_par *par)
u16 type;
u32 chip_id;
const char *name;
- int i;
-
- for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
+ int i, arrsize = ARRAY_SIZE(aty_chips);
+
+ for (i = 0; i < arrsize; i++)
if (par->pci_id == aty_chips[i].pci_id)
break;
- if (i < 0)
+ if (i == arrsize)
return -ENODEV;
name = aty_chips[i].name;
@@ -535,8 +535,6 @@ static int __devinit correct_chipset(struct atyfb_par *par)
return 0;
}
-static char ram_dram[] __devinitdata = "DRAM";
-static char ram_resv[] __devinitdata = "RESV";
#ifdef CONFIG_FB_ATY_GX
static char ram_vram[] __devinitdata = "VRAM";
#endif /* CONFIG_FB_ATY_GX */
--
1.7.0.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-10-19 16:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-19 16:53 [PATCH] ATI FB driver: fix variable size warnings Davidlohr Bueso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox