linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][2.4.28-pre3] 53c700 scsi driver gcc-3.4 fixes
@ 2004-09-12 11:21 Mikael Pettersson
  0 siblings, 0 replies; only message in thread
From: Mikael Pettersson @ 2004-09-12 11:21 UTC (permalink / raw)
  To: James.Bottomley, marcelo.tosatti; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-09-12 11:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-12 11:21 [PATCH][2.4.28-pre3] 53c700 scsi driver gcc-3.4 fixes Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).