Thanks, I've corrected these 2 bugs. The patch is attached.

/Kesmarki Attila


On SZE, 11 OKT 2000, you wrote:
> Another bug, fb_info_tdfx uses "unsigned long" for the "iobase"
> member, which is correct, but much code casts this value to a "u32"
> before using it which will break such I/O port accesses on Alpha and
> Sparc64 and perhaps other 64-bit platforms.
>
> Later,
> David S. Miller
> [EMAIL PROTECTED]

diff -u ./tdfx_base.c new/tdfx_base.c
--- ./tdfx_base.c	Wed Oct 11 01:25:09 2000
+++ new/tdfx_base.c	Wed Oct 11 09:48:48 2000
@@ -1429,9 +1429,9 @@
 	info->bufbase_virt =
 		ioremap_nocache(info->bufbase_phys, info->bufbase_size);
 
-   	if (!info->regbase_virt) {
+   	if (!info->bufbase_virt) {
 		printk("fb: Can't remap %s framebuffer.\n", name);
-		iounmap(info->regbase_virt);
+		iounmap(info->bufbase_virt);
 		goto err3;	
 	}
 
diff -u ./tdfx_hw.c new/tdfx_hw.c
--- ./tdfx_hw.c	Mon Oct  2 10:05:25 2000
+++ new/tdfx_hw.c	Wed Oct 11 09:55:06 2000
@@ -475,7 +475,7 @@
 void do_write_regs(struct fb_info_tdfx *info, struct banshee_reg *reg)
 {
 	int i;
-	u32 iobase = info->iobase;
+	unsigned long iobase = info->iobase;
 	void *mmiobase = info->regbase_virt;
     	
 	vga_disable_palette();
@@ -590,7 +590,7 @@
 {
 	u32 dacmode;
 	void *mmiobase = info->regbase_virt;
-	u32 iobase = info->iobase;
+	unsigned long iobase = info->iobase;
 
 	dacmode = tdfx_inl(DACMODE);
 	dacmode &= ~(BIT(1) | BIT(3));
@@ -734,7 +734,7 @@
 int do_card_preinit(struct fb_info_tdfx *info)
 {
    	int i;
-	u32 iobase = info->iobase;
+	unsigned long iobase = info->iobase;
    	void *mmiobase = info->regbase_virt;
    	u32 phys_addr,addr,len;
 	char *virtaddr;
@@ -852,19 +852,19 @@
 #ifdef TDFXFB_DEBUG
 int do_get_monitor_sense(struct fb_info_tdfx *info)
 {
-	u32 iobase = info->iobase;
+	unsigned long iobase = info->iobase;
 
 	return (vga_inb(iobase, VGA_IS0_R) & 0x10) >> 4;
 }
 
 int do_inb(struct fb_info_tdfx *info,int reg)
 {
-	u32 iobase = info->iobase;
+	unsigned long iobase = info->iobase;
  	return vga_inb(iobase,reg);  
 }
 void do_outb(struct fb_info_tdfx *info,int reg,int val)
 {
-	u32 iobase = info->iobase;
+	unsigned long iobase = info->iobase;
         vga_outb(iobase,reg,val);     
 }
 #endif
diff -u ./tdfx_hw.h new/tdfx_hw.h
--- ./tdfx_hw.h	Tue Oct 10 12:20:46 2000
+++ new/tdfx_hw.h	Wed Oct 11 09:53:51 2000
@@ -232,61 +232,61 @@
  *                      Hardware-specific inline funcions
  * ------------------------------------------------------------------------- */
 
-static inline u8 vga_inb(u32 iobase, u32 reg)
+static inline u8 vga_inb(unsigned long iobase, u32 reg)
 {
 	return inb(iobase + reg - 0x300);
 }
-static inline u16 vga_inl(u32 iobase, u32 reg)
+static inline u16 vga_inl(unsigned long iobase, u32 reg)
 {   
 	return inl(iobase + reg - 0x300);
 }
 
-static inline void vga_outb(u32 iobase, u32 reg, u8 val)
+static inline void vga_outb(unsigned long iobase, u32 reg, u8 val)
 {
 	outb(val, iobase + reg - 0x300);
 }
-static inline void vga_outl(u32 iobase, u32 reg, u32 val)
+static inline void vga_outl(unsigned long iobase, u32 reg, u32 val)
 {
 	outl(val, iobase + reg - 0x300);
 }
 
-static inline void gra_outb(u32 iobase, u32 idx, u8 val)
+static inline void gra_outb(unsigned long iobase, u32 idx, u8 val)
 {
 	vga_outb(iobase, VGA_GFX_I, idx);
 	vga_outb(iobase, VGA_GFX_D, val);
 }
 
-static inline u8 gra_inb(u32 iobase, u32 idx)
+static inline u8 gra_inb(unsigned long iobase, u32 idx)
 {
 	vga_outb(iobase, VGA_GFX_I, idx);
 	return vga_inb(iobase, VGA_GFX_D);
 }
 
-static inline void seq_outb(u32 iobase, u32 idx, u8 val)
+static inline void seq_outb(unsigned long iobase, u32 idx, u8 val)
 {
 	vga_outb(iobase, VGA_SEQ_I, idx);
 	vga_outb(iobase, VGA_SEQ_D, val);
 }
 
-static inline u8 seq_inb(u32 iobase, u32 idx)
+static inline u8 seq_inb(unsigned long iobase, u32 idx)
 {
 	vga_outb(iobase, VGA_SEQ_I, idx);
 	return vga_inb(iobase, VGA_SEQ_D);
 }
 
-static inline void crt_outb(u32 iobase, u32 idx, u8 val)
+static inline void crt_outb(unsigned long iobase, u32 idx, u8 val)
 {
 	vga_outb(iobase, VGA_CRT_IC, idx);
 	vga_outb(iobase, VGA_CRT_DC, val);
 }
 
-static inline u8 crt_inb(u32 iobase, u32 idx)
+static inline u8 crt_inb(unsigned long iobase, u32 idx)
 {
 	vga_outb(iobase, VGA_CRT_IC, idx);
 	return vga_inb(iobase, VGA_CRT_DC);
 }
 
-static inline void att_outb(u32 iobase, u32 idx, u8 val)
+static inline void att_outb(unsigned long iobase, u32 idx, u8 val)
 {
 	unsigned char tmp;
 	tmp = vga_inb(iobase, VGA_IS1_RC);
@@ -294,7 +294,7 @@
 	vga_outb(iobase, VGA_ATT_IW, val);
 }
 
-static inline u8 att_inb(u32 iobase, u32 idx)
+static inline u8 att_inb(unsigned long iobase, u32 idx)
 {
 	unsigned char tmp;
 	tmp = vga_inb(iobase, VGA_IS1_RC);
@@ -302,7 +302,7 @@
 	return vga_inb(iobase, VGA_ATT_R);
 }
 
-static inline void vga_disable_video(u32 iobase)
+static inline void vga_disable_video(unsigned long iobase)
 {
 	unsigned char s;
 	s = seq_inb(iobase, 0x01) | 0x20;
@@ -311,7 +311,7 @@
 	seq_outb(iobase, 0x00, 0x03);
 }
 
-static inline void vga_enable_video(u32 iobase)
+static inline void vga_enable_video(unsigned long iobase)
 {
 	unsigned char s;
 	s = seq_inb(iobase, 0x01) & 0xdf;
@@ -320,13 +320,13 @@
 	seq_outb(iobase, 0x00, 0x03);
 }
 
-static inline void vga_disable_palette(u32 iobase)
+static inline void vga_disable_palette(unsigned long iobase)
 {
 	vga_inb(iobase, VGA_IS1_RC);
 	vga_outb(iobase, VGA_ATT_IW, 0x00);
 }
 
-static inline void vga_enable_palette(u32 iobase)
+static inline void vga_enable_palette(unsigned long iobase)
 {
 	vga_inb(iobase, VGA_IS1_RC);
 	vga_outb(iobase, VGA_ATT_IW, 0x20);

Reply via email to