match_string() returns the array index of a matching string.
Use it instead of the open-coded implementation.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
#include <linux/io.h>
#include <linux/dmi.h>
#include <linux/slab.h>
+#include <linux/string.h>
#include <linux/wait.h>
#include <linux/err.h>
#include <linux/platform_device.h>
if (!hid)
return AE_OK;
- for (i = 0; i < ARRAY_SIZE(acpi_smo8800_ids); ++i) {
- if (strcmp(hid, acpi_smo8800_ids[i]) == 0) {
- *((bool *)return_value) = true;
- return AE_CTRL_TERMINATE;
- }
- }
+ i = match_string(acpi_smo8800_ids, ARRAY_SIZE(acpi_smo8800_ids), hid);
+ if (i < 0)
+ return AE_OK;
- return AE_OK;
+ *((bool *)return_value) = true;
+ return AE_CTRL_TERMINATE;
}
static bool is_dell_system_with_lis3lv02d(void)