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>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
This commit is contained in:
Sean Young 2018-01-15 09:43:48 +00:00 committed by Miguel Ojeda
parent 7223310f4e
commit 54bc937f0c
1 changed files with 4 additions and 3 deletions

View File

@ -192,10 +192,11 @@ static void charlcd_print(struct charlcd *lcd, char c)
c = lcd->char_conv[(unsigned char)c]; c = lcd->char_conv[(unsigned char)c];
lcd->ops->write_data(lcd, c); lcd->ops->write_data(lcd, c);
priv->addr.x++; 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) static void charlcd_clear_fast(struct charlcd *lcd)