diff options
Diffstat (limited to 'drivers/ata/pata_hpt37x.c')
-rw-r--r-- | drivers/ata/pata_hpt37x.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c index ff767755e98b..9e1eb473c0a1 100644 --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c | |||
@@ -349,23 +349,13 @@ static u32 hpt37x_find_mode(struct ata_port *ap, int speed) | |||
349 | 349 | ||
350 | static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[]) | 350 | static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[]) |
351 | { | 351 | { |
352 | unsigned char model_num[ATA_ID_PROD_LEN]; | 352 | unsigned char model_num[ATA_ID_PROD_LEN + 1]; |
353 | char *s; | ||
354 | unsigned int len; | ||
355 | int i = 0; | 353 | int i = 0; |
356 | 354 | ||
357 | ata_id_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); | 355 | ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); |
358 | s = &model_num[0]; | ||
359 | len = strnlen(s, sizeof(model_num)); | ||
360 | 356 | ||
361 | /* ATAPI specifies that empty space is blank-filled; remove blanks */ | 357 | while (list[i] != NULL) { |
362 | while ((len > 0) && (s[len - 1] == ' ')) { | 358 | if (!strcmp(list[i], model_num)) { |
363 | len--; | ||
364 | s[len] = 0; | ||
365 | } | ||
366 | |||
367 | while(list[i] != NULL) { | ||
368 | if (!strncmp(list[i], s, len)) { | ||
369 | printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", | 359 | printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", |
370 | modestr, list[i]); | 360 | modestr, list[i]); |
371 | return 1; | 361 | return 1; |