]> git.hungrycats.org Git - linux/commitdiff
Fix up and type-annotate sis fb driver
authorLinus Torvalds <torvalds@evo.osdl.org>
Thu, 30 Sep 2004 14:28:12 +0000 (07:28 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 30 Sep 2004 14:28:12 +0000 (07:28 -0700)
Some dual use type errors still exist, where the
bios mapping is type-confused.

drivers/video/sis/sis.h
drivers/video/sis/sis_main.c
drivers/video/sis/sis_main.h

index 97599dfd543b34ad0c206c44d3171b13d355d6ca..6638b5443ee487e046a69df5ba0ac5625e930737 100644 (file)
@@ -360,10 +360,10 @@ struct sis_video_info {
        unsigned long   mmio_base;
        unsigned long   vga_base;
 
-       unsigned long   video_vbase;
-       unsigned long   mmio_vbase;
-       char  *         bios_vbase;
-       char  *         bios_abase;
+       void __iomem *  video_vbase;
+       void __iomem *  mmio_vbase;
+       void __iomem *  bios_vbase;
+       void *          bios_abase;
 
        int             mtrr;
 
@@ -392,8 +392,8 @@ struct sis_video_info {
 #endif
 
        u32             heapstart;        /* offset  */
-       unsigned long   sisfb_heap_start; /* address */
-       unsigned long   sisfb_heap_end;   /* address */
+       void __iomem *  sisfb_heap_start; /* address */
+       void __iomem *  sisfb_heap_end;   /* address */
        u32             sisfb_heap_size;
        int             havenoheap;
 #if 0
@@ -469,7 +469,7 @@ struct sis_video_info {
        u8              detectedpdca;
        u8              detectedlcda;
 
-       unsigned long   hwcursor_vbase;
+       void __iomem *  hwcursor_vbase;
 
        int             chronteltype;
        int             tvxpos, tvypos;
index 1107b7e241262ac51322a8706b9c726b004d2225..72afe0838937c1c022fd982ec5c1f44cf0a85bba 100644 (file)
@@ -3952,19 +3952,19 @@ int __init sisfb_setup(char *options)
 }
 #endif
 
-static char * __devinit sis_find_rom(struct pci_dev *pdev)
+static void __iomem * __devinit sis_find_rom(struct pci_dev *pdev)
 {
        struct sis_video_info *ivideo = pci_get_drvdata(pdev);
 
 #if defined(__i386__) || defined(__x86_64__)
         u32  segstart;
-        unsigned char *rom_base, *rom;
+       void __iomem *rom_base, *rom;
         int  romptr;
        unsigned short pciid;
 
         for(segstart=0x000c0000; segstart<0x000f0000; segstart+=0x00001000) {
 
-            rom_base = (unsigned char *)ioremap(segstart, 0x10000);
+            rom_base = ioremap(segstart, 0x10000);
            if(!rom_base) continue;
 
            if((readb(rom_base) != 0x55) || (readb(rom_base + 1) != 0xaa)) {
@@ -3998,7 +3998,7 @@ static char * __devinit sis_find_rom(struct pci_dev *pdev)
            iounmap(rom_base);
         }
 #else
-       unsigned char *rom_base, *rom, *myrombase = NULL;
+       void __iomem *rom_base, *rom, *myrombase = NULL;
         int  romptr;
        unsigned short pciid;
        u32 backup;
@@ -4037,7 +4037,7 @@ static char * __devinit sis_find_rom(struct pci_dev *pdev)
 
 #ifdef CONFIG_FB_SIS_300
 static int __devinit
-sisfb_chkbuswidth300(struct pci_dev *pdev, ULONG FBAddress)
+sisfb_chkbuswidth300(struct pci_dev *pdev, void __iomem *FBAddress)
 {
        struct sis_video_info *ivideo = pci_get_drvdata(pdev);
        int i, j;
@@ -4080,7 +4080,7 @@ static void __devinit
 sisfb_setramsize300(struct pci_dev *pdev)
 {
        struct  sis_video_info *ivideo = pci_get_drvdata(pdev);
-       ULONG   FBAddr = (ULONG)ivideo->sishw_ext.pjVideoMemoryAddress, Addr;
+       void __iomem *FBAddr = ivideo->sishw_ext.pjVideoMemoryAddress, *Addr;
        USHORT  SR13, SR14=0, buswidth, Done, data, TotalCapacity, PhysicalAdrOtherPage=0;
        int     PseudoRankCapacity, PseudoTotalCapacity, PseudoAdrPinCount;
        int     RankCapacity, AdrPinCount, BankNumHigh, BankNumMid, MB2Bank;
@@ -4959,7 +4959,7 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                ivideo->modeprechange = 0x03;
 #if defined(__i386__) || defined(__x86_64__)
                {
-                       unsigned char *tt = ioremap(0, 0x1000);
+                       unsigned char __iomem *tt = ioremap(0, 0x1000);
                        if(tt) {
                                ivideo->modeprechange = tt[0x449];
                                iounmap(tt);
@@ -4993,7 +4993,8 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
 #endif
 
-       ivideo->bios_vbase = ivideo->bios_abase = NULL;
+       ivideo->bios_abase = NULL;
+       ivideo->bios_vbase = NULL;
        if(ivideo->sisfb_userom) {
            ivideo->sishw_ext.pjVirtualRomBase = sis_find_rom(pdev);
 #if defined(__i386__) || defined(__x86_64__)
@@ -5147,8 +5148,8 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                return -ENODEV;
        }
 
-       ivideo->video_vbase = (unsigned long)ioremap(ivideo->video_base, ivideo->video_size);
-       ivideo->sishw_ext.pjVideoMemoryAddress = (unsigned char *)ivideo->video_vbase;
+       ivideo->video_vbase = ioremap(ivideo->video_base, ivideo->video_size);
+       ivideo->sishw_ext.pjVideoMemoryAddress = ivideo->video_vbase;
        if(!ivideo->video_vbase) {
                printk(KERN_ERR "sisfb: Fatal error: Unable to map frame buffer memory\n");
                release_mem_region(ivideo->video_base, ivideo->video_size);
@@ -5160,10 +5161,10 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                return -ENODEV;
        }
 
-       ivideo->mmio_vbase = (unsigned long)ioremap(ivideo->mmio_base, ivideo->mmio_size);
+       ivideo->mmio_vbase = ioremap(ivideo->mmio_base, ivideo->mmio_size);
        if(!ivideo->mmio_vbase) {
                printk(KERN_ERR "sisfb: Fatal error: Unable to map MMIO region\n");
-               iounmap((void *)ivideo->video_vbase);
+               iounmap(ivideo->video_vbase);
                release_mem_region(ivideo->video_base, ivideo->video_size);
                release_mem_region(ivideo->mmio_base, ivideo->mmio_size);
                if(ivideo->bios_abase) vfree(ivideo->bios_abase);
@@ -5173,10 +5174,10 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                return -ENODEV;
        }
 
-       printk(KERN_INFO "sisfb: Framebuffer at 0x%lx, mapped to 0x%lx, size %ldk\n",
+       printk(KERN_INFO "sisfb: Framebuffer at 0x%lx, mapped to 0x%p, size %ldk\n",
                ivideo->video_base, ivideo->video_vbase, ivideo->video_size / 1024);
 
-       printk(KERN_INFO "sisfb: MMIO at 0x%lx, mapped to 0x%lx, size %ldk\n",
+       printk(KERN_INFO "sisfb: MMIO at 0x%lx, mapped to 0x%p, size %ldk\n",
                ivideo->mmio_base, ivideo->mmio_vbase, ivideo->mmio_size / 1024);
 
        if((ivideo->havenoheap = sisfb_heap_init(ivideo))) {
@@ -5450,8 +5451,8 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                if(SiSSetMode(&ivideo->SiS_Pr, &ivideo->sishw_ext, ivideo->mode_no) == 0) {
                        printk(KERN_ERR "sisfb: Fatal error: Setting mode[0x%x] failed\n",
                                                                        ivideo->mode_no);
-                       iounmap((void *)ivideo->video_vbase);
-                       iounmap((void *)ivideo->mmio_vbase);
+                       iounmap(ivideo->video_vbase);
+                       iounmap(ivideo->mmio_vbase);
                        release_mem_region(ivideo->video_base, ivideo->video_size);
                        release_mem_region(ivideo->mmio_base, ivideo->mmio_size);
                        if(ivideo->bios_abase) vfree(ivideo->bios_abase);
@@ -5549,7 +5550,7 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 #endif
                sis_fb_info->var = ivideo->default_var;
                sis_fb_info->fix = ivideo->sisfb_fix;
-               sis_fb_info->screen_base = (char *)ivideo->video_vbase;
+               sis_fb_info->screen_base = ivideo->video_vbase;
                sis_fb_info->fbops = &sisfb_ops;
 
                sisfb_get_fix(&sis_fb_info->fix, -1, sis_fb_info);
@@ -5574,8 +5575,8 @@ int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
                if(register_framebuffer(sis_fb_info) < 0) {
                        printk(KERN_ERR "sisfb: Fatal error: Failed to register framebuffer\n");
-                       iounmap((void *)ivideo->video_vbase);
-                       iounmap((void *)ivideo->mmio_vbase);
+                       iounmap(ivideo->video_vbase);
+                       iounmap(ivideo->mmio_vbase);
                        release_mem_region(ivideo->video_base, ivideo->video_size);
                        release_mem_region(ivideo->mmio_base, ivideo->mmio_size);
                        if(ivideo->bios_abase) vfree(ivideo->bios_abase);
@@ -5669,8 +5670,8 @@ static void __devexit sisfb_remove(struct pci_dev *pdev)
 #endif
 
        /* Unmap */
-       iounmap((void *)ivideo->video_vbase);
-       iounmap((void *)ivideo->mmio_vbase);
+       iounmap(ivideo->video_vbase);
+       iounmap(ivideo->mmio_vbase);
        if(ivideo->bios_vbase) iounmap(ivideo->bios_vbase);
        if(ivideo->bios_abase)    vfree(ivideo->bios_abase);
 
index 3f9298d52292de059fd198d79dad7e3fe0884e2b..176a9b165eafdcb4b95fb7c0fce61e0695530fc8 100644 (file)
@@ -880,7 +880,7 @@ static int      sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
                        struct fb_info *info);
 static void     sisfb_pre_setmode(struct sis_video_info *ivideo);
 static void     sisfb_post_setmode(struct sis_video_info *ivideo);
-static char *   sis_find_rom(struct pci_dev *pdev);
+static void __iomem *sis_find_rom(struct pci_dev *pdev);
 static BOOLEAN  sisfb_CheckVBRetrace(struct sis_video_info *ivideo);
 static BOOLEAN  sisfbcheckvretracecrt2(struct sis_video_info *ivideo);
 static BOOLEAN  sisfbcheckvretracecrt1(struct sis_video_info *ivideo);