[patch] advansys: fix timestamp for 64 bit

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

 



Timestamp assertion compares int and unsigned long. Fails on 64 bit machines where unsigned long is 8 bytes instead of 4. Promote int (from scsi_cmnd.this_residual) to unsigned long (jiffies) so it is a proper comparison on both 32 bit and 64 bit architectures.

Tested on AMD64

Signed-off-by: Ken Witherow <ken@xxxxxxxxxxx>


--- linux-2.6.23-gentoo-r2/drivers/scsi/advansys.c.orig	2007-11-21 02:33:00.000000000 -0500
+++ linux-2.6.23-gentoo-r1/drivers/scsi/advansys.c	2007-11-21 17:37:56.000000000 -0500
@@ -3497,7 +3497,7 @@ typedef struct scsi_cmnd REQ, *REQP;
      * If the request time stamp is less than the system time stamp, then \
      * maybe the system time stamp wrapped. Set the request time to zero.\
      */ \
-    if (REQPTIME(reqp) <= REQTIMESTAMP()) { \
+    if ((unsigned long) REQPTIME(reqp) <= REQTIMESTAMP()) { \
         REQPTIME(reqp) = REQTIMESTAMP() - REQPTIME(reqp); \
     } else { \
         /* Indicate an error occurred with the assertion. */ \
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux