ide: hpt366: convert to use match_string() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 17 Mar 2016 21:22:35 +0000 (14:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Mar 2016 22:09:34 +0000 (15:09 -0700)
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>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/ide/hpt366.c

index 696b6c1ec940fce29de2dc41d5d91d6b860467bf..f94baadbf42474ed67f71b02635c48d1496b7f2a 100644 (file)
@@ -531,14 +531,9 @@ static const struct hpt_info hpt371n = {
        .timings        = &hpt37x_timings
 };
 
-static int check_in_drive_list(ide_drive_t *drive, const char **list)
+static bool check_in_drive_list(ide_drive_t *drive, const char **list)
 {
-       char *m = (char *)&drive->id[ATA_ID_PROD];
-
-       while (*list)
-               if (!strcmp(*list++, m))
-                       return 1;
-       return 0;
+       return match_string(list, -1, (char *)&drive->id[ATA_ID_PROD]) >= 0;
 }
 
 static struct hpt_info *hpt3xx_get_info(struct device *dev)