diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-07 05:17:13 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-07 05:17:34 -0400 |
commit | 44347d947f628060b92449702071bfe1d31dfb75 (patch) | |
tree | c6ed74610d5b3295df4296659f80f5feb94b28cc /drivers/scsi/sd.c | |
parent | d94fc523f3c35bd8013f04827e94756cbc0212f4 (diff) | |
parent | 413f81eba35d6ede9289b0c8a920c013a84fac71 (diff) |
Merge branch 'linus' into tracing/core
Merge reason: tracing/core was on a .30-rc1 base and was missing out on
on a handful of tracing fixes present in .30-rc5-almost.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 3fcb64b91c43..84044233b637 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <linux/string_helpers.h> | 50 | #include <linux/string_helpers.h> |
51 | #include <linux/async.h> | 51 | #include <linux/async.h> |
52 | #include <asm/uaccess.h> | 52 | #include <asm/uaccess.h> |
53 | #include <asm/unaligned.h> | ||
53 | 54 | ||
54 | #include <scsi/scsi.h> | 55 | #include <scsi/scsi.h> |
55 | #include <scsi/scsi_cmnd.h> | 56 | #include <scsi/scsi_cmnd.h> |
@@ -1344,12 +1345,8 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, | |||
1344 | return -EINVAL; | 1345 | return -EINVAL; |
1345 | } | 1346 | } |
1346 | 1347 | ||
1347 | sector_size = (buffer[8] << 24) | (buffer[9] << 16) | | 1348 | sector_size = get_unaligned_be32(&buffer[8]); |
1348 | (buffer[10] << 8) | buffer[11]; | 1349 | lba = get_unaligned_be64(&buffer[0]); |
1349 | lba = (((u64)buffer[0] << 56) | ((u64)buffer[1] << 48) | | ||
1350 | ((u64)buffer[2] << 40) | ((u64)buffer[3] << 32) | | ||
1351 | ((u64)buffer[4] << 24) | ((u64)buffer[5] << 16) | | ||
1352 | ((u64)buffer[6] << 8) | (u64)buffer[7]); | ||
1353 | 1350 | ||
1354 | sd_read_protection_type(sdkp, buffer); | 1351 | sd_read_protection_type(sdkp, buffer); |
1355 | 1352 | ||
@@ -1400,10 +1397,8 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp, | |||
1400 | return -EINVAL; | 1397 | return -EINVAL; |
1401 | } | 1398 | } |
1402 | 1399 | ||
1403 | sector_size = (buffer[4] << 24) | (buffer[5] << 16) | | 1400 | sector_size = get_unaligned_be32(&buffer[4]); |
1404 | (buffer[6] << 8) | buffer[7]; | 1401 | lba = get_unaligned_be32(&buffer[0]); |
1405 | lba = (buffer[0] << 24) | (buffer[1] << 16) | | ||
1406 | (buffer[2] << 8) | buffer[3]; | ||
1407 | 1402 | ||
1408 | if ((sizeof(sdkp->capacity) == 4) && (lba == 0xffffffff)) { | 1403 | if ((sizeof(sdkp->capacity) == 4) && (lba == 0xffffffff)) { |
1409 | sd_printk(KERN_ERR, sdkp, "Too big for this kernel. Use a " | 1404 | sd_printk(KERN_ERR, sdkp, "Too big for this kernel. Use a " |