X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fsd.c;h=354199011246633ce9cf8fcc172231648492d6ef;hb=3a778275626c0eb97674e92875efeba01189ce0e;hp=c647d85d97d14555fc93f02d28ed98d580ff3be3;hpb=74d89c16735d83349ea74232031819e989a49156;p=linux-2.6-omap-h63xx.git diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index c647d85d97d..35419901124 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -175,7 +175,7 @@ static ssize_t sd_store_cache_type(struct class_device *cdev, const char *buf, * it's not worth the risk */ return -EINVAL; - for (i = 0; i < sizeof(sd_cache_types)/sizeof(sd_cache_types[0]); i++) { + for (i = 0; i < ARRAY_SIZE(sd_cache_types); i++) { const int len = strlen(sd_cache_types[i]); if (strncmp(sd_cache_types[i], buf, len) == 0 && buf[len] == '\n') { @@ -891,7 +891,7 @@ static struct block_device_operations sd_fops = { static void sd_rw_intr(struct scsi_cmnd * SCpnt) { int result = SCpnt->result; - int this_count = SCpnt->bufflen; + int this_count = SCpnt->request_bufflen; int good_bytes = (result == 0 ? this_count : 0); sector_t block_sectors = 1; u64 first_err_block;