aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-05-03 17:20:16 -0400
committerTejun Heo <tj@kernel.org>2018-05-07 11:50:30 -0400
commitdc85ca573b95e99d325ab9fbd430c52c6f67501b (patch)
tree0a2f13852f431e3f3a17fb4ca603f0f39405d47f
parent75bc37fefc4471e718ba8e651aa74673d4e0a9eb (diff)
ata: hpt37x: Convert to use match_string() helper
The new helper returns index of the matching string in an array. We are going to use it here. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--drivers/ata/pata_hpt37x.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index 3ba843f5cdc0..ef8aaeb0c575 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -224,17 +224,14 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr,
224 const char * const list[]) 224 const char * const list[])
225{ 225{
226 unsigned char model_num[ATA_ID_PROD_LEN + 1]; 226 unsigned char model_num[ATA_ID_PROD_LEN + 1];
227 int i = 0; 227 int i;
228 228
229 ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); 229 ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
230 230
231 while (list[i] != NULL) { 231 i = match_string(list, -1, model_num);
232 if (!strcmp(list[i], model_num)) { 232 if (i >= 0) {
233 pr_warn("%s is not supported for %s\n", 233 pr_warn("%s is not supported for %s\n", modestr, list[i]);
234 modestr, list[i]); 234 return 1;
235 return 1;
236 }
237 i++;
238 } 235 }
239 return 0; 236 return 0;
240} 237}