Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1304517 > unrolled thread

[PATCH v3 8/9] ide: hpt366: convert to use match_string() helper

Started byAndy Shevchenko <andriy.shevchenko@linux.intel.com>
First post2016-01-08 14:10 +0100
Last post2016-01-08 14:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 8/9] ide: hpt366: convert to use match_string() helper Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-08 14:10 +0100

#1304517 — [PATCH v3 8/9] ide: hpt366: convert to use match_string() helper

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2016-01-08 14:10 +0100
Subject[PATCH v3 8/9] ide: hpt366: convert to use match_string() helper
Message-ID<qOEXM-7an-25@gated-at.bofh.it>
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>
---
 drivers/ide/hpt366.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c
index 696b6c1..f94baad 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)
-- 
2.6.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web