drm: panel-orientation-quirks: Convert to use match_string() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 3 May 2018 18:41:19 +0000 (21:41 +0300)
committerSean Paul <seanpaul@chromium.org>
Thu, 10 May 2018 15:36:25 +0000 (11:36 -0400)
The new helper returns index of the matching string in an array.
We are going to use it here.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180503184119.22355-1-andriy.shevchenko@linux.intel.com
drivers/gpu/drm/drm_panel_orientation_quirks.c

index caebddda8bce91322f4ba81963ec60ea8a301444..fe9c6c731e8787e1480a436bceb544a811c9b8c5 100644 (file)
@@ -172,10 +172,9 @@ int drm_get_panel_orientation_quirk(int width, int height)
                if (!bios_date)
                        continue;
 
-               for (i = 0; data->bios_dates[i]; i++) {
-                       if (!strcmp(data->bios_dates[i], bios_date))
-                               return data->orientation;
-               }
+               i = match_string(data->bios_dates, -1, bios_date);
+               if (i >= 0)
+                       return data->orientation;
        }
 
        return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;