lkml.org 
[lkml]   [2020]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 31/32] auxdisplay: charlcd: Do not print chars at end of line
Date
From: Lars Poeschel <poeschel@lemonage.de>

Skip printing characters at the end of a display line. This fits to the
behaviour we already had, that the cursor is nailed to last position of
a line.

Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
---
drivers/auxdisplay/charlcd.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index cd3a304c08ec..1d5b3af9cca7 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -111,6 +111,9 @@ static void charlcd_home(struct charlcd *lcd)

static void charlcd_print(struct charlcd *lcd, char c)
{
+ if (lcd->addr.x >= lcd->width)
+ return;
+
if (lcd->char_conv)
c = lcd->char_conv[(unsigned char)c];

--
2.28.0
\
 
 \ /
  Last update: 2020-09-21 16:48    [W:0.198 / U:1.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site