From: Andy Shevchenko Date: Thu, 17 Mar 2016 21:22:35 +0000 (-0700) Subject: ide: hpt366: convert to use match_string() helper X-Git-Tag: Ubuntu-5.0.0-8.9~7607^2~10 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=9adb9254f4b0f591282f713de5356a9e75a44da3;p=mirror_ubuntu-disco-kernel.git ide: 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 Cc: "David S. Miller" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c index 696b6c1ec940..f94baadbf424 100644 --- a/drivers/ide/hpt366.c +++ b/drivers/ide/hpt366.c @@ -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)