aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-01-02 06:18:49 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-09 17:39:30 -0500
commita0cf733b333eeeafb7324e2897448006c693c26c (patch)
tree9a08b3e197cf4d1d17c39ed93cbcdd26fd722316 /drivers/ata/libata-core.c
parentcdf56bcf14b9d441777703eef95eef807e4136ec (diff)
libata: straighten out ATA_ID_* constants
* Kill _OFS suffixes in ATA_ID_{SERNO|FW_REV|PROD}_OFS for consistency with other ATA_ID_* constants. * Kill ATA_SERNO_LEN * Add and use ATA_ID_SERNO_LEN, ATA_ID_FW_REV_LEN and ATA_ID_PROD_LEN. This change also makes ata_device_blacklisted() use proper length for fwrev. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 2869469790b0..7d4b002568e7 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3187,7 +3187,8 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
3187 const u16 *new_id) 3187 const u16 *new_id)
3188{ 3188{
3189 const u16 *old_id = dev->id; 3189 const u16 *old_id = dev->id;
3190 unsigned char model[2][41], serial[2][21]; 3190 unsigned char model[2][ATA_ID_PROD_LEN + 1];
3191 unsigned char serial[2][ATA_ID_SERNO_LEN + 1];
3191 u64 new_n_sectors; 3192 u64 new_n_sectors;
3192 3193
3193 if (dev->class != new_class) { 3194 if (dev->class != new_class) {
@@ -3196,10 +3197,10 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
3196 return 0; 3197 return 0;
3197 } 3198 }
3198 3199
3199 ata_id_c_string(old_id, model[0], ATA_ID_PROD_OFS, sizeof(model[0])); 3200 ata_id_c_string(old_id, model[0], ATA_ID_PROD, sizeof(model[0]));
3200 ata_id_c_string(new_id, model[1], ATA_ID_PROD_OFS, sizeof(model[1])); 3201 ata_id_c_string(new_id, model[1], ATA_ID_PROD, sizeof(model[1]));
3201 ata_id_c_string(old_id, serial[0], ATA_ID_SERNO_OFS, sizeof(serial[0])); 3202 ata_id_c_string(old_id, serial[0], ATA_ID_SERNO, sizeof(serial[0]));
3202 ata_id_c_string(new_id, serial[1], ATA_ID_SERNO_OFS, sizeof(serial[1])); 3203 ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1]));
3203 new_n_sectors = ata_id_n_sectors(new_id); 3204 new_n_sectors = ata_id_n_sectors(new_id);
3204 3205
3205 if (strcmp(model[0], model[1])) { 3206 if (strcmp(model[0], model[1])) {
@@ -3338,15 +3339,13 @@ static int ata_strim(char *s, size_t len)
3338 3339
3339unsigned long ata_device_blacklisted(const struct ata_device *dev) 3340unsigned long ata_device_blacklisted(const struct ata_device *dev)
3340{ 3341{
3341 unsigned char model_num[40]; 3342 unsigned char model_num[ATA_ID_PROD_LEN];
3342 unsigned char model_rev[16]; 3343 unsigned char model_rev[ATA_ID_FW_REV_LEN];
3343 unsigned int nlen, rlen; 3344 unsigned int nlen, rlen;
3344 const struct ata_blacklist_entry *ad = ata_device_blacklist; 3345 const struct ata_blacklist_entry *ad = ata_device_blacklist;
3345 3346
3346 ata_id_string(dev->id, model_num, ATA_ID_PROD_OFS, 3347 ata_id_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
3347 sizeof(model_num)); 3348 ata_id_string(dev->id, model_rev, ATA_ID_FW_REV, sizeof(model_rev));
3348 ata_id_string(dev->id, model_rev, ATA_ID_FW_REV_OFS,
3349 sizeof(model_rev));
3350 nlen = ata_strim(model_num, sizeof(model_num)); 3349 nlen = ata_strim(model_num, sizeof(model_num));
3351 rlen = ata_strim(model_rev, sizeof(model_rev)); 3350 rlen = ata_strim(model_rev, sizeof(model_rev));
3352 3351