fb: fix atyfb unused data warnings
[firefly-linux-kernel-4.4.55.git] / drivers / video / aty / atyfb_base.c
index 4f27fdc58d8463650fec54d9020496c89810b9bc..a89c15de9f45c885f3dc7fe76bad22bde184013d 100644 (file)
@@ -58,6 +58,7 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
+#include <linux/compiler.h>
 #include <linux/console.h>
 #include <linux/fb.h>
 #include <linux/init.h>
@@ -434,8 +435,8 @@ static int correct_chipset(struct atyfb_par *par)
        const char *name;
        int i;
 
-       for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
-               if (par->pci_id == aty_chips[i].pci_id)
+       for (i = ARRAY_SIZE(aty_chips); i > 0; i--)
+               if (par->pci_id == aty_chips[i - 1].pci_id)
                        break;
 
        if (i < 0)
@@ -531,8 +532,8 @@ static int correct_chipset(struct atyfb_par *par)
        return 0;
 }
 
-static char ram_dram[] = "DRAM";
-static char ram_resv[] = "RESV";
+static char ram_dram[] __maybe_unused = "DRAM";
+static char ram_resv[] __maybe_unused = "RESV";
 #ifdef CONFIG_FB_ATY_GX
 static char ram_vram[] = "VRAM";
 #endif /* CONFIG_FB_ATY_GX */