[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANiq72kaDBJX5mc8UwrzdTs7my_Eb96o5bU6v-+FQ5wydmw6pQ@mail.gmail.com>
Date: Fri, 16 Oct 2020 05:25:47 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Lars Poeschel <poeschel@...onage.de>
Cc: open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 32/32] auxdisplay: add a driver for lcd2s character display
On Mon, Oct 5, 2020 at 3:01 PM <poeschel@...onage.de> wrote:
>
> + while (*esc && i < LCD2S_CHARACTER_SIZE + 2) {
> + shift ^= 4;
> + if (*esc >= '0' && *esc <= '9') {
> + value |= (*esc - '0') << shift;
> + } else if (*esc >= 'A' && *esc <= 'Z') {
> + value |= (*esc - 'A' + 10) << shift;
> + } else if (*esc >= 'a' && *esc <= 'z') {
> + value |= (*esc - 'a' + 10) << shift;
This should also probably use hex_to_bin() or similar (see my other
comment on patch 24) and/or share the implementation as much as
possible.
Cheers,
Miguel
Powered by blists - more mailing lists