All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mans Rullgard <mans@mansr.com>
To: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] auxdisplay: charlcd: simplify init message display
Date: Fri,  1 Mar 2019 18:48:15 +0000	[thread overview]
Message-ID: <20190301184816.784-2-mans@mansr.com> (raw)
In-Reply-To: <20190301184816.784-1-mans@mansr.com>

If CONFIG_PANEL_CHANGE_MESSAGE is set, CONFIG_PANEL_BOOT_MESSAGE will
also be defined, so the double ifdef is pointless.  Simplify the code
further by using an intermediate macro rather duplicating most of the
line.

Signed-off-by: Mans Rullgard <mans@mansr.com>
---
 drivers/auxdisplay/charlcd.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index 60e0b772673f..db0356dca2d7 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -763,6 +763,12 @@ static void charlcd_puts(struct charlcd *lcd, const char *s)
 	}
 }
 
+#ifdef CONFIG_PANEL_BOOT_MESSAGE
+#define LCD_INIT_TEXT CONFIG_PANEL_BOOT_MESSAGE
+#else
+#define LCD_INIT_TEXT "Linux-" UTS_RELEASE "\n"
+#endif
+
 /* initialize the LCD driver */
 static int charlcd_init(struct charlcd *lcd)
 {
@@ -784,13 +790,8 @@ static int charlcd_init(struct charlcd *lcd)
 		return ret;
 
 	/* display a short message */
-#ifdef CONFIG_PANEL_CHANGE_MESSAGE
-#ifdef CONFIG_PANEL_BOOT_MESSAGE
-	charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*" CONFIG_PANEL_BOOT_MESSAGE);
-#endif
-#else
-	charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*Linux-" UTS_RELEASE "\n");
-#endif
+	charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*" LCD_INIT_TEXT);
+
 	/* clear the display on the next device opening */
 	priv->must_clear = true;
 	charlcd_home(lcd);
-- 
2.20.1


  reply	other threads:[~2019-03-01 18:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 18:48 [PATCH 1/3] auxdisplay: deconfuse configuration Mans Rullgard
2019-03-01 18:48 ` Mans Rullgard [this message]
2019-03-06 10:03   ` [PATCH 2/3] auxdisplay: charlcd: simplify init message display Miguel Ojeda
2019-03-01 18:48 ` [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable Mans Rullgard
2019-03-06  9:56   ` Miguel Ojeda
2019-03-06 10:03     ` Miguel Ojeda
2019-03-06 14:49     ` Måns Rullgård
2019-03-12 15:45   ` Andy Shevchenko
2019-03-12 15:48     ` Måns Rullgård
2019-03-17  7:43       ` Miguel Ojeda
2019-03-17 16:52         ` Måns Rullgård
2019-03-06 10:14 ` [PATCH 1/3] auxdisplay: deconfuse configuration Miguel Ojeda
2019-03-06 15:08   ` Måns Rullgård
2019-03-23 14:28   ` Miguel Ojeda
2019-03-23 14:50     ` Randy Dunlap
2019-03-23 15:00       ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190301184816.784-2-mans@mansr.com \
    --to=mans@mansr.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.