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>
This commit is contained in:
Tejun Heo
2007-01-02 20:18:49 +09:00
committed by Jeff Garzik
parent cdf56bcf14
commit a0cf733b33
9 changed files with 45 additions and 46 deletions

View File

@@ -531,15 +531,14 @@ static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused
static void it821x_dev_config(struct ata_port *ap, struct ata_device *adev)
{
unsigned char model_num[40];
unsigned char model_num[ATA_ID_PROD_LEN];
char *s;
unsigned int len;
/* This block ought to be a library routine as it is in several
drivers now */
ata_id_string(adev->id, model_num, ATA_ID_PROD_OFS,
sizeof(model_num));
ata_id_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num));
s = &model_num[0];
len = strnlen(s, sizeof(model_num));