Re: [PATCH 0/3] Staging: vt6655: remove PBYTE/PWORD/PDWORD typedef

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 18, 2010 at 10:25:28AM -0700, Greg KH wrote:
> On Fri, Jun 18, 2010 at 10:21:03AM -0700, Greg KH wrote:
> > On Sat, Jun 05, 2010 at 03:13:46PM -0700, Charles Clément wrote:
> > > Remove the following typedef from ttype.h and replace with the actual type:
> > > 	PBYTE	->	unsigned char *
> > > 	PWORD	->	unsigned short *
> > > 	PDWORD	->	unsigned long *
> > 
> > After applying all of your typedef cleanup patches, I'm getting a bunch
> > of compiler warnings on x86-64 like:
> > 	drivers/staging/vt6655/iwctl.c: In function ‘iwctl_get_wireless_stats’:
> > 	drivers/staging/vt6655/iwctl.c:119:36: warning: cast from pointer to integer of different size
> > 
> > I'll go see what went wrong...
> 
> Ah, found it:
> 	Staging: vt6655: remove U32 custom macro
> was wrong.
> 
> The line:
> 	-typedef unsigned long           U32;    /* 32-bit unsigned integer */
> 
> was fine, but you then went and made "U32" a "u32" all through the
> driver, which you would think would be correct based on the code.  But
> it's not, you need to make it a real "unsigned long" instead.
> 
> I'll go see if I can revert this one by hand or just fix it up...

It's simpler just to fix the few places that this really wanted to be an
unsigned long.  Here's the fixup patch I just applied that gets rid of
the build warnings, and hopefully makes the code work properly again:

thanks,

greg k-h


commit afb97d9a265f6001411df43d3ea523338c73c83f
Author: Greg Kroah-Hartman <gregkh@xxxxxxx>
Date:   Fri Jun 18 10:30:21 2010 -0700

    Staging: vt6655: fix up U32 conversion
    
    Commit 902d2411298a6e0b8a473a0163aa4bf6d5c8a073 converted U32 to u32
    which you would think would be just fine.  Unfortunatly, it seems that
    VIA only builds their code on a 32bit processor (which makes sense if
    you think about it), but this doesn't work on x86-64.  So fix up the few
    places where this really wanted to be an unsigned long width.
    
    Cc: Charles Clément <caratorn@xxxxxxxxx>
    Cc: Forest Bond <forest@xxxxxxxxxxxxxxxxxxx>,
    Cc: Andres More <more.andres@xxxxxxxxx>
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 9e236f7..bad3256 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -423,7 +423,7 @@ typedef struct __device_info {
 
     CHIP_TYPE                   chip_id;
 
-    u32                         PortOffset;
+    unsigned long               PortOffset;
     DWORD                       dwIsr;
     u32                         memaddr;
     u32                         ioaddr;
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index a2b2bc5..f354507 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -116,7 +116,7 @@ struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev)
 	pDevice->wstats.discard.nwid = 0;
 	pDevice->wstats.discard.code = 0;
 	pDevice->wstats.discard.fragment = 0;
-	pDevice->wstats.discard.retries = (u32)pDevice->scStatistic.dwTsrErr;
+	pDevice->wstats.discard.retries = (unsigned long)pDevice->scStatistic.dwTsrErr;
 	pDevice->wstats.discard.misc = 0;
 	pDevice->wstats.miss.beacon = 0;
 
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux