Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Tejun Heo
dc85ca57 75bc37fe

+5 -8
+5 -8
drivers/ata/pata_hpt37x.c
··· 224 224 const char * const list[]) 225 225 { 226 226 unsigned char model_num[ATA_ID_PROD_LEN + 1]; 227 - int i = 0; 227 + int i; 228 228 229 229 ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); 230 230 231 - while (list[i] != NULL) { 232 - if (!strcmp(list[i], model_num)) { 233 - pr_warn("%s is not supported for %s\n", 234 - modestr, list[i]); 235 - return 1; 236 - } 237 - i++; 231 + i = match_string(list, -1, model_num); 232 + if (i >= 0) { 233 + pr_warn("%s is not supported for %s\n", modestr, list[i]); 234 + return 1; 238 235 } 239 236 return 0; 240 237 }