All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper
@ 2018-05-03 18:04 Andy Shevchenko
  2018-05-15 10:37 ` Bartlomiej Zolnierkiewicz
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Andy Shevchenko @ 2018-05-03 18:04 UTC (permalink / raw)
  To: linux-fbdev

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/video/fbdev/pxafb.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index c3d49e13643c..0c013f1efe81 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2099,7 +2099,7 @@ static void pxafb_check_options(struct device *dev, struct pxafb_mach_info *inf)
 
 #if defined(CONFIG_OF)
 static const char * const lcd_types[] = {
-	"unknown", "mono-stn", "mono-dstn", "color-stn", "color-dstn",
+	"mono-stn", "mono-dstn", "color-stn", "color-dstn",
 	"color-tft", "smart-panel", NULL
 };
 
@@ -2115,12 +2115,10 @@ static int of_get_pxafb_display(struct device *dev, struct device_node *disp,
 	if (ret)
 		s = "color-tft";
 
-	for (i = 0; lcd_types[i]; i++)
-		if (!strcmp(s, lcd_types[i]))
-			break;
-	if (!i || !lcd_types[i]) {
+	i = match_string(lcd_types, -1, s);
+	if (i < 0) {
 		dev_err(dev, "lcd-type %s is unknown\n", s);
-		return -EINVAL;
+		return i;
 	}
 	info->lcd_conn |= LCD_CONN_TYPE(i);
 	info->lcd_conn |= LCD_CONN_WIDTH(bus_width);
-- 
2.17.0


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

* Re: [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper
  2018-05-03 18:04 [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper Andy Shevchenko
@ 2018-05-15 10:37 ` Bartlomiej Zolnierkiewicz
  2018-05-15 11:35 ` Andy Shevchenko
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-15 10:37 UTC (permalink / raw)
  To: linux-fbdev

On Thursday, May 03, 2018 09:04:23 PM 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>

Patch queued for 4.18, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


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

* Re: [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper
  2018-05-03 18:04 [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper Andy Shevchenko
  2018-05-15 10:37 ` Bartlomiej Zolnierkiewicz
@ 2018-05-15 11:35 ` Andy Shevchenko
  2018-05-15 11:54 ` Bartlomiej Zolnierkiewicz
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2018-05-15 11:35 UTC (permalink / raw)
  To: linux-fbdev

On Tue, 2018-05-15 at 12:37 +0200, Bartlomiej Zolnierkiewicz wrote:
> On Thursday, May 03, 2018 09:04:23 PM 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>
> 
> Patch queued for 4.18, thanks.

I went through it again and found a bug, the type "unknown" should be
left untouched.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper
  2018-05-03 18:04 [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper Andy Shevchenko
  2018-05-15 10:37 ` Bartlomiej Zolnierkiewicz
  2018-05-15 11:35 ` Andy Shevchenko
@ 2018-05-15 11:54 ` Bartlomiej Zolnierkiewicz
  2018-05-15 11:59 ` Andy Shevchenko
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-15 11:54 UTC (permalink / raw)
  To: linux-fbdev

On Tuesday, May 15, 2018 02:35:03 PM Andy Shevchenko wrote:
> On Tue, 2018-05-15 at 12:37 +0200, Bartlomiej Zolnierkiewicz wrote:
> > On Thursday, May 03, 2018 09:04:23 PM 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>
> > 
> > Patch queued for 4.18, thanks.
> 
> I went through it again and found a bug, the type "unknown" should be
> left untouched.

Indeed, could you provide incremental fix?

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


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

* Re: [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper
  2018-05-03 18:04 [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper Andy Shevchenko
                   ` (2 preceding siblings ...)
  2018-05-15 11:54 ` Bartlomiej Zolnierkiewicz
@ 2018-05-15 11:59 ` Andy Shevchenko
  2018-05-15 12:17 ` Bartlomiej Zolnierkiewicz
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2018-05-15 11:59 UTC (permalink / raw)
  To: linux-fbdev

On Tue, 2018-05-15 at 13:54 +0200, Bartlomiej Zolnierkiewicz wrote:
> On Tuesday, May 15, 2018 02:35:03 PM Andy Shevchenko wrote:
> > On Tue, 2018-05-15 at 12:37 +0200, Bartlomiej Zolnierkiewicz wrote:
> > > On Thursday, May 03, 2018 09:04:23 PM 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.co
> > > > m>
> > > 
> > > Patch queued for 4.18, thanks.
> > 
> > I went through it again and found a bug, the type "unknown" should
> > be
> > left untouched.
> 
> Indeed, could you provide incremental fix?

Is it late enough to drop patch completely? If so, I do a fix asap.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper
  2018-05-03 18:04 [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper Andy Shevchenko
                   ` (3 preceding siblings ...)
  2018-05-15 11:59 ` Andy Shevchenko
@ 2018-05-15 12:17 ` Bartlomiej Zolnierkiewicz
  2018-05-15 16:06 ` Bartlomiej Zolnierkiewicz
  2018-05-15 16:23 ` Andy Shevchenko
  6 siblings, 0 replies; 8+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-15 12:17 UTC (permalink / raw)
  To: linux-fbdev

On Tuesday, May 15, 2018 02:59:20 PM Andy Shevchenko wrote:
> On Tue, 2018-05-15 at 13:54 +0200, Bartlomiej Zolnierkiewicz wrote:
> > On Tuesday, May 15, 2018 02:35:03 PM Andy Shevchenko wrote:
> > > On Tue, 2018-05-15 at 12:37 +0200, Bartlomiej Zolnierkiewicz wrote:
> > > > On Thursday, May 03, 2018 09:04:23 PM 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.co
> > > > > m>
> > > > 
> > > > Patch queued for 4.18, thanks.
> > > 
> > > I went through it again and found a bug, the type "unknown" should
> > > be
> > > left untouched.
> > 
> > Indeed, could you provide incremental fix?
> 
> Is it late enough to drop patch completely? If so, I do a fix asap.

It is already merged in publicly available tree (which is not being
rebased) so it is too late to drop it completely.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


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

* Re: [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper
  2018-05-03 18:04 [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper Andy Shevchenko
                   ` (4 preceding siblings ...)
  2018-05-15 12:17 ` Bartlomiej Zolnierkiewicz
@ 2018-05-15 16:06 ` Bartlomiej Zolnierkiewicz
  2018-05-15 16:23 ` Andy Shevchenko
  6 siblings, 0 replies; 8+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-05-15 16:06 UTC (permalink / raw)
  To: linux-fbdev

On Tuesday, May 15, 2018 02:17:35 PM Bartlomiej Zolnierkiewicz wrote:
> On Tuesday, May 15, 2018 02:59:20 PM Andy Shevchenko wrote:
> > On Tue, 2018-05-15 at 13:54 +0200, Bartlomiej Zolnierkiewicz wrote:
> > > On Tuesday, May 15, 2018 02:35:03 PM Andy Shevchenko wrote:
> > > > On Tue, 2018-05-15 at 12:37 +0200, Bartlomiej Zolnierkiewicz wrote:
> > > > > On Thursday, May 03, 2018 09:04:23 PM 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.co
> > > > > > m>
> > > > > 
> > > > > Patch queued for 4.18, thanks.
> > > > 
> > > > I went through it again and found a bug, the type "unknown" should
> > > > be
> > > > left untouched.
> > > 
> > > Indeed, could you provide incremental fix?
> > 
> > Is it late enough to drop patch completely? If so, I do a fix asap.
> 
> It is already merged in publicly available tree (which is not being
> rebased) so it is too late to drop it completely.

OK, I fixed it myself with the patch below.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: [PATCH] video: fbdev: pxafb: match_string() conversion fixup

"unknown" lcd_types[] entry is needed for proper operation of
the driver, add it back.

Fixes: 6d09dfe70f8f ("video: fbdev: pxafb: Convert to use match_string() helper")
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/video/fbdev/pxafb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/drivers/video/fbdev/pxafb.c
=================================--- a/drivers/video/fbdev/pxafb.c	2018-05-15 17:41:00.922315366 +0200
+++ b/drivers/video/fbdev/pxafb.c	2018-05-15 17:42:27.474317546 +0200
@@ -2099,7 +2099,7 @@ static void pxafb_check_options(struct d
 
 #if defined(CONFIG_OF)
 static const char * const lcd_types[] = {
-	"mono-stn", "mono-dstn", "color-stn", "color-dstn",
+	"unknown", "mono-stn", "mono-dstn", "color-stn", "color-dstn",
 	"color-tft", "smart-panel", NULL
 };
 


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

* Re: [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper
  2018-05-03 18:04 [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper Andy Shevchenko
                   ` (5 preceding siblings ...)
  2018-05-15 16:06 ` Bartlomiej Zolnierkiewicz
@ 2018-05-15 16:23 ` Andy Shevchenko
  6 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2018-05-15 16:23 UTC (permalink / raw)
  To: linux-fbdev

On Tue, 2018-05-15 at 18:06 +0200, Bartlomiej Zolnierkiewicz wrote:
> On Tuesday, May 15, 2018 02:17:35 PM Bartlomiej Zolnierkiewicz wrote:
> > On Tuesday, May 15, 2018 02:59:20 PM Andy Shevchenko wrote:

> > It is already merged in publicly available tree (which is not being
> > rebased) so it is too late to drop it completely.

Oh, sorry for that.

> OK, I fixed it myself with the patch below.
> 

> From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Subject: [PATCH] video: fbdev: pxafb: match_string() conversion fixup
> 
> "unknown" lcd_types[] entry is needed for proper operation of
> the driver, add it back.

Yes, that's correct now.

I was thinking that we perhaps add a comment that the list of these
names should be in sync with definitions in the header.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

end of thread, other threads:[~2018-05-15 16:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 18:04 [PATCH v1] video: fbdev: pxafb: Convert to use match_string() helper Andy Shevchenko
2018-05-15 10:37 ` Bartlomiej Zolnierkiewicz
2018-05-15 11:35 ` Andy Shevchenko
2018-05-15 11:54 ` Bartlomiej Zolnierkiewicz
2018-05-15 11:59 ` Andy Shevchenko
2018-05-15 12:17 ` Bartlomiej Zolnierkiewicz
2018-05-15 16:06 ` Bartlomiej Zolnierkiewicz
2018-05-15 16:23 ` Andy Shevchenko

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.