]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/sd.c
[SCSI] sd: fix computation of the full size of the device
[linux-2.6-omap-h63xx.git] / drivers / scsi / sd.c
index 55e6ed4b886d110c742d15f535c7a00529601a69..7ba70bef8b5d03e8f5cd41ab35e2906123381e56 100644 (file)
@@ -1084,15 +1084,6 @@ static int sd_done(struct scsi_cmnd *SCpnt)
                        scsi_print_sense("sd", SCpnt);
                        good_bytes = sd_completed_bytes(SCpnt);
                }
-               if (!scsi_device_protection(SCpnt->device) &&
-                   SCpnt->device->use_10_for_rw &&
-                   (SCpnt->cmnd[0] == READ_10 ||
-                    SCpnt->cmnd[0] == WRITE_10))
-                       SCpnt->device->use_10_for_rw = 0;
-               if (SCpnt->device->use_10_for_ms &&
-                   (SCpnt->cmnd[0] == MODE_SENSE_10 ||
-                    SCpnt->cmnd[0] == MODE_SELECT_10))
-                       SCpnt->device->use_10_for_ms = 0;
                break;
        default:
                break;
@@ -1445,7 +1436,7 @@ got_data:
 
        {
                char cap_str_2[10], cap_str_10[10];
-               u64 sz = sdkp->capacity << ffz(~sector_size);
+               u64 sz = (u64)sdkp->capacity << ilog2(sector_size);
 
                string_get_size(sz, STRING_UNITS_2, cap_str_2,
                                sizeof(cap_str_2));