Re: [PATCH 1/5] auxdisplay: charlcd: no need to call charlcd_gotoxy() if nothing changes

2018-02-12 Thread Miguel Ojeda
On Mon, Feb 12, 2018 at 2:59 PM, Geert Uytterhoeven
 wrote:
> On Mon, Feb 12, 2018 at 2:42 PM, Miguel Ojeda
>  wrote:
>> On Mon, Jan 15, 2018 at 10:58 AM, Sean Young  wrote:
>>> 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 
>>> ---
>>>  drivers/auxdisplay/charlcd.c | 7 ---
>>>  1 file 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);
>>>  }
>>>
>>
>> Willy, Geert: is this fine with you? Seems fine: charlcd_write_char()
>> right now does an unconditional write_cmd() when writing a normal
>> character; so unless some HW requires the command for some reason even
>> if there is nothing changed, we can skip it.
>
> Reviewed-by: Geert Uytterhoeven 
>

Thanks a lot, picking it up then.

Miguel

> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- 
> ge...@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like 
> that.
> -- Linus Torvalds


Re: [PATCH 1/5] auxdisplay: charlcd: no need to call charlcd_gotoxy() if nothing changes

2018-02-12 Thread Geert Uytterhoeven
On Mon, Feb 12, 2018 at 2:42 PM, Miguel Ojeda
 wrote:
> On Mon, Jan 15, 2018 at 10:58 AM, Sean Young  wrote:
>> 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 
>> ---
>>  drivers/auxdisplay/charlcd.c | 7 ---
>>  1 file 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);
>>  }
>>
>
> Willy, Geert: is this fine with you? Seems fine: charlcd_write_char()
> right now does an unconditional write_cmd() when writing a normal
> character; so unless some HW requires the command for some reason even
> if there is nothing changed, we can skip it.

Reviewed-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


Re: [PATCH 1/5] auxdisplay: charlcd: no need to call charlcd_gotoxy() if nothing changes

2018-02-12 Thread Miguel Ojeda
On Mon, Jan 15, 2018 at 10:58 AM, Sean Young  wrote:
> 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 
> ---
>  drivers/auxdisplay/charlcd.c | 7 ---
>  1 file 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);
>  }
>

Willy, Geert: is this fine with you? Seems fine: charlcd_write_char()
right now does an unconditional write_cmd() when writing a normal
character; so unless some HW requires the command for some reason even
if there is nothing changed, we can skip it.

>  static void charlcd_clear_fast(struct charlcd *lcd)
> --
> 2.14.3
>