aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2018-01-12 20:40:51 +0000
committerSean Young <sean@mess.org>2018-01-14 20:15:40 +0000
commit0cb9a05c09295bcad4dd914ee44806ac6c244cbd (patch)
treee5d05e3d0f29ba896c633c1aaae60bd5da5ea07f
parentbd4ca2f02f47233ca29f18dd2731b0d64d2d5e62 (diff)
auxdisplay: charlcd: no need to call charlcd_gotoxy() if nothing changes
If the line extends beyond the width to the screen, nothing changes. The existing code will call charlcd_gotoxy every time for this case. Signed-off-by: Sean Young <sean@mess.org>
-rw-r--r--drivers/auxdisplay/charlcd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index 642afd88870b..45ec5ce697c4 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -192,10 +192,11 @@ static void charlcd_print(struct charlcd *lcd, char c)
c = lcd->char_conv[(unsigned char)c];
lcd->ops->write_data(lcd, c);
priv->addr.x++;
+
+ /* prevents the cursor from wrapping onto the next line */
+ if (priv->addr.x == lcd->bwidth)
+ charlcd_gotoxy(lcd);
}
- /* prevents the cursor from wrapping onto the next line */
- if (priv->addr.x == lcd->bwidth)
- charlcd_gotoxy(lcd);
}
static void charlcd_clear_fast(struct charlcd *lcd)

Privacy Policy