diff options
author | Tejun Heo <htejun@gmail.com> | 2006-02-12 22:47:04 +0900 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-12 14:24:41 -0500 |
commit | 2e02671daa2cd69d93c828c40579bbe953f17210 (patch) | |
tree | bcafe5d5b36be475de57081600fae13408cd0c4e /drivers/scsi/libata-core.c | |
parent | 0e949ff304a7ca07db38c17fbbf3ead1085d7bbf (diff) | |
download | lwn-2e02671daa2cd69d93c828c40579bbe953f17210.tar.gz lwn-2e02671daa2cd69d93c828c40579bbe953f17210.zip |
[PATCH] libata: use ata_dev_id_c_string()
Use ata_dev_id_c_string()
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 7e410299d67a..1d65f703348e 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -2301,24 +2301,14 @@ static const char * const ata_dma_blacklist [] = { static int ata_dma_blacklisted(const struct ata_device *dev) { - unsigned char model_num[40]; - char *s; - unsigned int len; + unsigned char model_num[41]; int i; - ata_dev_id_string(dev->id, model_num, ATA_ID_PROD_OFS, - sizeof(model_num)); - s = &model_num[0]; - len = strnlen(s, sizeof(model_num)); - - /* ATAPI specifies that empty space is blank-filled; remove blanks */ - while ((len > 0) && (s[len - 1] == ' ')) { - len--; - s[len] = 0; - } + ata_dev_id_c_string(dev->id, model_num, ATA_ID_PROD_OFS, + sizeof(model_num)); for (i = 0; i < ARRAY_SIZE(ata_dma_blacklist); i++) - if (!strncmp(ata_dma_blacklist[i], s, len)) + if (!strcmp(ata_dma_blacklist[i], model_num)) return 1; return 0; |