lkml.org 
[lkml]   [2004]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][2.4.28-pre3] 53c700 scsi driver gcc-3.4 fixes
This patch fixes gcc-3.4 cast-as-lvalue warnings in the 2.4.28-pre3
kernel's drivers/scsi/53c700.h. With the exception of NCR_700_set_SXFER(),
the changes are all backports from the 2.6 kernel.

/Mikael

--- linux-2.4.28-pre3/drivers/scsi/53c700.h.~1~ 2002-02-26 13:26:57.000000000 +0100
+++ linux-2.4.28-pre3/drivers/scsi/53c700.h 2004-09-12 02:09:09.000000000 +0200
@@ -109,8 +109,11 @@
static inline void
NCR_700_set_SXFER(Scsi_Device *SDp, __u8 sxfer)
{
- ((unsigned long)SDp->hostdata) &= 0xffffff00;
- ((unsigned long)SDp->hostdata) |= sxfer & 0xff;
+ long l = (long)SDp->hostdata;
+
+ l &= 0xffffff00;
+ l |= sxfer & 0xff;
+ SDp->hostdata = (void *)l;
}
static inline __u8 NCR_700_get_SXFER(Scsi_Device *SDp)
{
@@ -119,8 +122,11 @@
static inline void
NCR_700_set_depth(Scsi_Device *SDp, __u8 depth)
{
- ((unsigned long)SDp->hostdata) &= 0xffff00ff;
- ((unsigned long)SDp->hostdata) |= (0xff00 & (depth << 8));
+ long l = (long)SDp->hostdata;
+
+ l &= 0xffff00ff;
+ l |= 0xff00 & (depth << 8);
+ SDp->hostdata = (void *)l;
}
static inline __u8
NCR_700_get_depth(Scsi_Device *SDp)
@@ -140,12 +146,12 @@
static inline void
NCR_700_set_flag(Scsi_Device *SDp, __u32 flag)
{
- ((unsigned long)SDp->hostdata) |= (flag & 0xffff0000);
+ SDp->hostdata = (void *)((long)SDp->hostdata | (flag & 0xffff0000));
}
static inline void
NCR_700_clear_flag(Scsi_Device *SDp, __u32 flag)
{
- ((unsigned long)SDp->hostdata) &= ~(flag & 0xffff0000);
+ SDp->hostdata = (void *)((long)SDp->hostdata & ~(flag & 0xffff0000));
}

/* These represent the Nexus hashing functions. A Nexus in SCSI terms
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.030 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site