[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190508112842.11654-17-alexandru.ardelean@analog.com>
Date: Wed, 8 May 2019 14:28:41 +0300
From: Alexandru Ardelean <alexandru.ardelean@...log.com>
To: <linuxppc-dev@...ts.ozlabs.org>, <linux-kernel@...r.kernel.org>,
<linux-ide@...r.kernel.org>, <linux-clk@...r.kernel.org>,
<linux-rpi-kernel@...ts.infradead.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-rockchip@...ts.infradead.org>, <linux-pm@...r.kernel.org>,
<linux-gpio@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
<intel-gfx@...ts.freedesktop.org>, <linux-omap@...r.kernel.org>,
<linux-mmc@...r.kernel.org>, <linux-wireless@...r.kernel.org>,
<netdev@...r.kernel.org>, <linux-pci@...r.kernel.org>,
<linux-tegra@...r.kernel.org>, <devel@...verdev.osuosl.org>,
<linux-usb@...r.kernel.org>, <kvm@...r.kernel.org>,
<linux-fbdev@...r.kernel.org>, <linux-mtd@...ts.infradead.org>,
<cgroups@...r.kernel.org>, <linux-mm@...ck.org>,
<linux-security-module@...r.kernel.org>,
<linux-integrity@...r.kernel.org>, <alsa-devel@...a-project.org>
CC: <gregkh@...uxfoundation.org>, <andriy.shevchenko@...ux.intel.com>,
Alexandru Ardelean <alexandru.ardelean@...log.com>
Subject: [PATCH 15/16] video: fbdev: pxafb: use new match_string() helper/macro
The `lcd_types` array is a static array of strings.
Using match_string() (which computes the array size via ARRAY_SIZE())
is possible.
This reduces the array by 1 element, since the NULL (at the end of the
array) is no longer needed.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@...log.com>
---
drivers/video/fbdev/pxafb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index 0025781e6e1e..e657a04f5b1d 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2114,7 +2114,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",
- "color-tft", "smart-panel", NULL
+ "color-tft", "smart-panel"
};
static int of_get_pxafb_display(struct device *dev, struct device_node *disp,
@@ -2129,7 +2129,7 @@ static int of_get_pxafb_display(struct device *dev, struct device_node *disp,
if (ret)
s = "color-tft";
- i = __match_string(lcd_types, -1, s);
+ i = match_string(lcd_types, s);
if (i < 0) {
dev_err(dev, "lcd-type %s is unknown\n", s);
return i;
--
2.17.1
Powered by blists - more mailing lists