diff options
author | Tejun Heo <htejun@gmail.com> | 2006-03-13 05:48:04 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-16 19:22:57 -0500 |
commit | 1148c3a78aa9f1e84229cd17f94fd38a15ca65bd (patch) | |
tree | c9457d928ad25530dc80261966e1045c3de8d89d /drivers/scsi | |
parent | 6e48f1b763ab1115a58c86684153635050155387 (diff) |
[PATCH] libata: use local *id instead of dev->id in ata_dev_configure()
dev->id is used many times in ata_dev_configure(). Use local variable
id instead for shorter notation.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/libata-core.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 439b6db13802..6fe41fb03929 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -1193,6 +1193,7 @@ static inline u8 ata_dev_knobble(const struct ata_port *ap, | |||
1193 | static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, | 1193 | static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, |
1194 | int print_info) | 1194 | int print_info) |
1195 | { | 1195 | { |
1196 | const u16 *id = dev->id; | ||
1196 | unsigned int xfer_mask; | 1197 | unsigned int xfer_mask; |
1197 | int i, rc; | 1198 | int i, rc; |
1198 | 1199 | ||
@@ -1218,27 +1219,27 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, | |||
1218 | */ | 1219 | */ |
1219 | 1220 | ||
1220 | /* we require DMA support (bits 8 of word 49) */ | 1221 | /* we require DMA support (bits 8 of word 49) */ |
1221 | if (!ata_id_has_dma(dev->id)) { | 1222 | if (!ata_id_has_dma(id)) { |
1222 | printk(KERN_DEBUG "ata%u: no dma\n", ap->id); | 1223 | printk(KERN_DEBUG "ata%u: no dma\n", ap->id); |
1223 | rc = -EINVAL; | 1224 | rc = -EINVAL; |
1224 | goto err_out_nosup; | 1225 | goto err_out_nosup; |
1225 | } | 1226 | } |
1226 | 1227 | ||
1227 | /* find max transfer mode; for printk only */ | 1228 | /* find max transfer mode; for printk only */ |
1228 | xfer_mask = ata_id_xfermask(dev->id); | 1229 | xfer_mask = ata_id_xfermask(id); |
1229 | 1230 | ||
1230 | ata_dump_id(dev->id); | 1231 | ata_dump_id(id); |
1231 | 1232 | ||
1232 | /* ATA-specific feature tests */ | 1233 | /* ATA-specific feature tests */ |
1233 | if (dev->class == ATA_DEV_ATA) { | 1234 | if (dev->class == ATA_DEV_ATA) { |
1234 | dev->n_sectors = ata_id_n_sectors(dev->id); | 1235 | dev->n_sectors = ata_id_n_sectors(id); |
1235 | 1236 | ||
1236 | if (ata_id_has_lba(dev->id)) { | 1237 | if (ata_id_has_lba(id)) { |
1237 | const char *lba_desc; | 1238 | const char *lba_desc; |
1238 | 1239 | ||
1239 | lba_desc = "LBA"; | 1240 | lba_desc = "LBA"; |
1240 | dev->flags |= ATA_DFLAG_LBA; | 1241 | dev->flags |= ATA_DFLAG_LBA; |
1241 | if (ata_id_has_lba48(dev->id)) { | 1242 | if (ata_id_has_lba48(id)) { |
1242 | dev->flags |= ATA_DFLAG_LBA48; | 1243 | dev->flags |= ATA_DFLAG_LBA48; |
1243 | lba_desc = "LBA48"; | 1244 | lba_desc = "LBA48"; |
1244 | } | 1245 | } |
@@ -1248,7 +1249,7 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, | |||
1248 | printk(KERN_INFO "ata%u: dev %u ATA-%d, " | 1249 | printk(KERN_INFO "ata%u: dev %u ATA-%d, " |
1249 | "max %s, %Lu sectors: %s\n", | 1250 | "max %s, %Lu sectors: %s\n", |
1250 | ap->id, dev->devno, | 1251 | ap->id, dev->devno, |
1251 | ata_id_major_version(dev->id), | 1252 | ata_id_major_version(id), |
1252 | ata_mode_string(xfer_mask), | 1253 | ata_mode_string(xfer_mask), |
1253 | (unsigned long long)dev->n_sectors, | 1254 | (unsigned long long)dev->n_sectors, |
1254 | lba_desc); | 1255 | lba_desc); |
@@ -1256,15 +1257,15 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, | |||
1256 | /* CHS */ | 1257 | /* CHS */ |
1257 | 1258 | ||
1258 | /* Default translation */ | 1259 | /* Default translation */ |
1259 | dev->cylinders = dev->id[1]; | 1260 | dev->cylinders = id[1]; |
1260 | dev->heads = dev->id[3]; | 1261 | dev->heads = id[3]; |
1261 | dev->sectors = dev->id[6]; | 1262 | dev->sectors = id[6]; |
1262 | 1263 | ||
1263 | if (ata_id_current_chs_valid(dev->id)) { | 1264 | if (ata_id_current_chs_valid(id)) { |
1264 | /* Current CHS translation is valid. */ | 1265 | /* Current CHS translation is valid. */ |
1265 | dev->cylinders = dev->id[54]; | 1266 | dev->cylinders = id[54]; |
1266 | dev->heads = dev->id[55]; | 1267 | dev->heads = id[55]; |
1267 | dev->sectors = dev->id[56]; | 1268 | dev->sectors = id[56]; |
1268 | } | 1269 | } |
1269 | 1270 | ||
1270 | /* print device info to dmesg */ | 1271 | /* print device info to dmesg */ |
@@ -1272,7 +1273,7 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, | |||
1272 | printk(KERN_INFO "ata%u: dev %u ATA-%d, " | 1273 | printk(KERN_INFO "ata%u: dev %u ATA-%d, " |
1273 | "max %s, %Lu sectors: CHS %u/%u/%u\n", | 1274 | "max %s, %Lu sectors: CHS %u/%u/%u\n", |
1274 | ap->id, dev->devno, | 1275 | ap->id, dev->devno, |
1275 | ata_id_major_version(dev->id), | 1276 | ata_id_major_version(id), |
1276 | ata_mode_string(xfer_mask), | 1277 | ata_mode_string(xfer_mask), |
1277 | (unsigned long long)dev->n_sectors, | 1278 | (unsigned long long)dev->n_sectors, |
1278 | dev->cylinders, dev->heads, dev->sectors); | 1279 | dev->cylinders, dev->heads, dev->sectors); |
@@ -1283,7 +1284,7 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, | |||
1283 | 1284 | ||
1284 | /* ATAPI-specific feature tests */ | 1285 | /* ATAPI-specific feature tests */ |
1285 | else if (dev->class == ATA_DEV_ATAPI) { | 1286 | else if (dev->class == ATA_DEV_ATAPI) { |
1286 | rc = atapi_cdb_len(dev->id); | 1287 | rc = atapi_cdb_len(id); |
1287 | if ((rc < 12) || (rc > ATAPI_CDB_LEN)) { | 1288 | if ((rc < 12) || (rc > ATAPI_CDB_LEN)) { |
1288 | printk(KERN_WARNING "ata%u: unsupported CDB len\n", ap->id); | 1289 | printk(KERN_WARNING "ata%u: unsupported CDB len\n", ap->id); |
1289 | rc = -EINVAL; | 1290 | rc = -EINVAL; |