Messages in this thread | | | From | Andy Shevchenko <> | Date | Tue, 13 Feb 2018 15:36:45 +0200 | Subject | Re: [PATCH 1/3] auxdisplay: charlcd: fix hex literal ranges for graphics command |
| |
On Sat, Feb 10, 2018 at 11:41 AM, Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote: > On Sat, Feb 10, 2018 at 10:20 AM, Willy Tarreau <w@1wt.eu> wrote: >> On Sat, Feb 10, 2018 at 09:58:44AM +0100, Miguel Ojeda wrote: >>> On Sat, Feb 10, 2018 at 12:50 AM, Robert Abel <rabel@robertabel.eu> wrote:
>>> > shift ^= 4; >>> > if (*esc >= '0' && *esc <= '9') { >>> > value |= (*esc - '0') << shift; >>> > - } else if (*esc >= 'A' && *esc <= 'Z') { >>> > + } else if (*esc >= 'A' && *esc <= 'F') { >>> > value |= (*esc - 'A' + 10) << shift; >>> > - } else if (*esc >= 'a' && *esc <= 'z') { >>> > + } else if (*esc >= 'a' && *esc <= 'f') { >>> >>> Willy, Geert: this seems obvious, but do you know if the broader range >>> was intended for some reason? >> >> No, I think it was simply a brain fart from me 14 years ago, as I can >> find it as well in the original 0.9.0 patch for kernel 2.4!
I understand that we have a huge and hopefully nice library in the kernel, but the question still the same, what prevents a developer or maintainer to look at it from time to time?
For, I dare to say, ages we have hex_to_bin() and hex2bin(). Can we use it?
-- With Best Regards, Andy Shevchenko
| |