]> git.hungrycats.org Git - linux/commitdiff
[PATCH] isd200 bugfix for 64bit boxen
authorAlexander Viro <viro@www.linux.org.uk>
Wed, 6 Oct 2004 00:56:27 +0000 (17:56 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 6 Oct 2004 00:56:27 +0000 (17:56 -0700)
unsigned long is not a good type to use in declaration of structure we feed
to hardware...

Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/usb/storage/isd200.c

index a6aa4a918d1e918328affb6698285e0c083da55d..62493c0ec5d36097032edcf23c94e0945f8d5ce6 100644 (file)
@@ -295,8 +295,8 @@ struct isd200_info {
  */
 
 struct read_capacity_data {
-       unsigned long LogicalBlockAddress;
-       unsigned long BytesPerBlock;
+       __u32 LogicalBlockAddress;
+       __u32 BytesPerBlock;
 };
 
 /*
@@ -1221,8 +1221,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us,
        case READ_10:
                US_DEBUGP("   ATA OUT - SCSIOP_READ\n");
 
-               lba = *(unsigned long *)&srb->cmnd[2]; 
-               lba = cpu_to_be32(lba);
+               lba = be32_to_cpu(*(__be32 *)&srb->cmnd[2]);
                blockCount = (unsigned long)srb->cmnd[7]<<8 | (unsigned long)srb->cmnd[8];
 
                if (id->capability & CAPABILITY_LBA) {
@@ -1254,8 +1253,7 @@ static int isd200_scsi_to_ata(struct scsi_cmnd *srb, struct us_data *us,
        case WRITE_10:
                US_DEBUGP("   ATA OUT - SCSIOP_WRITE\n");
 
-               lba = *(unsigned long *)&srb->cmnd[2]; 
-               lba = cpu_to_be32(lba);
+               lba = be32_to_cpu(*(__be32 *)&srb->cmnd[2]);
                blockCount = (unsigned long)srb->cmnd[7]<<8 | (unsigned long)srb->cmnd[8];
 
                if (id->capability & CAPABILITY_LBA) {