All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] drm: panel-orientation-quirks: Convert to use match_string() helper
@ 2018-05-03 18:41 Andy Shevchenko
  2018-05-03 19:16 ` Sean Paul
  2018-05-07  8:12 ` Hans de Goede
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2018-05-03 18:41 UTC (permalink / raw)
  To: Gustavo Padovan, Maarten Lankhorst, Sean Paul, dri-devel, Hans de Goede
  Cc: Andy Shevchenko

The new helper returns index of the matching string in an array.
We are going to use it here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpu/drm/drm_panel_orientation_quirks.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c
index caebddda8bce..fe9c6c731e87 100644
--- a/drivers/gpu/drm/drm_panel_orientation_quirks.c
+++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c
@@ -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;
-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] drm: panel-orientation-quirks: Convert to use match_string() helper
  2018-05-03 18:41 [PATCH v1] drm: panel-orientation-quirks: Convert to use match_string() helper Andy Shevchenko
@ 2018-05-03 19:16 ` Sean Paul
  2018-05-07  8:12 ` Hans de Goede
  1 sibling, 0 replies; 4+ messages in thread
From: Sean Paul @ 2018-05-03 19:16 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: dri-devel, Hans de Goede

On Thu, May 03, 2018 at 09:41:19PM +0300, Andy Shevchenko wrote:
> The new helper returns index of the matching string in an array.
> We are going to use it here.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Sean Paul <seanpaul@chromium.org>

> ---
>  drivers/gpu/drm/drm_panel_orientation_quirks.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c
> index caebddda8bce..fe9c6c731e87 100644
> --- a/drivers/gpu/drm/drm_panel_orientation_quirks.c
> +++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c
> @@ -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;
> -- 
> 2.17.0
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] drm: panel-orientation-quirks: Convert to use match_string() helper
  2018-05-03 18:41 [PATCH v1] drm: panel-orientation-quirks: Convert to use match_string() helper Andy Shevchenko
  2018-05-03 19:16 ` Sean Paul
@ 2018-05-07  8:12 ` Hans de Goede
  2018-05-10 19:03   ` Sean Paul
  1 sibling, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2018-05-07  8:12 UTC (permalink / raw)
  To: Andy Shevchenko, Gustavo Padovan, Maarten Lankhorst, Sean Paul,
	dri-devel

Hi,

On 03-05-18 20:41, Andy Shevchenko wrote:
> The new helper returns index of the matching string in an array.
> We are going to use it here.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Thanks, LGTM:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> ---
>   drivers/gpu/drm/drm_panel_orientation_quirks.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c
> index caebddda8bce..fe9c6c731e87 100644
> --- a/drivers/gpu/drm/drm_panel_orientation_quirks.c
> +++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c
> @@ -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;
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] drm: panel-orientation-quirks: Convert to use match_string() helper
  2018-05-07  8:12 ` Hans de Goede
@ 2018-05-10 19:03   ` Sean Paul
  0 siblings, 0 replies; 4+ messages in thread
From: Sean Paul @ 2018-05-10 19:03 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Andy Shevchenko, dri-devel

On Mon, May 07, 2018 at 10:12:47AM +0200, Hans de Goede wrote:
> Hi,
> 
> On 03-05-18 20:41, Andy Shevchenko wrote:
> > The new helper returns index of the matching string in an array.
> > We are going to use it here.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Thanks, LGTM:
> 
> Acked-by: Hans de Goede <hdegoede@redhat.com>

Applied to drm-misc-next with Hans' Ack.

Thanks for the patch!

Sean

> 
> Regards,
> 
> Hans
> 
> 
> 
> > ---
> >   drivers/gpu/drm/drm_panel_orientation_quirks.c | 7 +++----
> >   1 file changed, 3 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c
> > index caebddda8bce..fe9c6c731e87 100644
> > --- a/drivers/gpu/drm/drm_panel_orientation_quirks.c
> > +++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c
> > @@ -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;
> > 

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-10 19:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 18:41 [PATCH v1] drm: panel-orientation-quirks: Convert to use match_string() helper Andy Shevchenko
2018-05-03 19:16 ` Sean Paul
2018-05-07  8:12 ` Hans de Goede
2018-05-10 19:03   ` Sean Paul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.