ata: hpt366: convert to use match_string() helper
The new helper returns index of the mathing string in an array. We would use it here. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Tejun Heo <tj@kernel.org> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
ea32cea140
commit
908913bdbd
@ -176,18 +176,15 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr,
|
|||||||
const char * const list[])
|
const char * const list[])
|
||||||
{
|
{
|
||||||
unsigned char model_num[ATA_ID_PROD_LEN + 1];
|
unsigned char model_num[ATA_ID_PROD_LEN + 1];
|
||||||
int i = 0;
|
int i;
|
||||||
|
|
||||||
ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
|
ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
|
||||||
|
|
||||||
while (list[i] != NULL) {
|
i = match_string(list, -1, model_num);
|
||||||
if (!strcmp(list[i], model_num)) {
|
if (i >= 0) {
|
||||||
pr_warn("%s is not supported for %s\n",
|
pr_warn("%s is not supported for %s\n", modestr, list[i]);
|
||||||
modestr, list[i]);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user