Received: by 10.223.185.116 with SMTP id b49csp4013823wrg; Tue, 13 Feb 2018 11:16:22 -0800 (PST) X-Google-Smtp-Source: AH8x227h7Bwm1yYVdAKOYDnNhW+GSFrmxeC79yZ6n6KQ/PlBHn6D4i6lTG0g44pBPYK2e/Hb9+j3 X-Received: by 10.99.116.25 with SMTP id p25mr1815691pgc.109.1518549381879; Tue, 13 Feb 2018 11:16:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518549381; cv=none; d=google.com; s=arc-20160816; b=b80VeYhUfpoaA/RwvSGd3stHmj2RsuG2VsVBONFLSezjTb8I4l3r1IhK6nQ6kO7Zkw E2HjuzVJE31PP+mJrTRDN8now16biyfBDe+87JS6rLk9fZL5A/OMgY/EvmnIqV639IuG AoTZ7T4pPQHWymlKlSRwY0pxW8mOfEfFxuabY9tNfoPMtqsAZSmce+CvWxLm+MWiUdl/ dbQVodIu1AMw2Pn40JPvtc7n0DOVcsrzBNzi2ABrZ93LDZa3wzPVFTMRR9Dd9s13p8w0 DNGPqcwbvIrsC3xCvkZz6of5zKIEi1OF69gXjGOq0bHP6Paoa3WiaWz+bBZOLFv8ti7z LLag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=qgSoyugCKVMgwXyowS4+6W2ev0UUea/ljY3RDn/Hiis=; b=n4Wul9OEnGAI7Pg/fm6mvltTLsUbqTy1L2+CUmYf/YbWEXBW1TwEzKZQPel+RM4lI8 D+vgP81CSp6rsJdRyufj1JAQRlH5I5sRKEcfNBptVcQd3Fp0WDCYb9yl+kdUCzQMGv8b etFhnxkzisgzFNlj6c6BYcbJSQuiT3x12RQqc/36tAUG5xvrhQFrnN1d4EQgX8sPkPaZ iihOc/L9xrLEu/63Wg0s47U/jRU/J8N71LOcq9adZiIhD0AB+7t1yjVCwuNpgRwusT4h SXQlx+LJbo96XIVNL2L39BgTA5ffIq+AN8vxeRYHQW0UqbpOQQdNVphOhJiJrCwK2j/G 0kqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4-v6si630695plp.199.2018.02.13.11.16.07; Tue, 13 Feb 2018 11:16:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965498AbeBMTPQ (ORCPT + 99 others); Tue, 13 Feb 2018 14:15:16 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:40596 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965315AbeBMTPP (ORCPT ); Tue, 13 Feb 2018 14:15:15 -0500 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id w1DJF9qj020753; Tue, 13 Feb 2018 20:15:09 +0100 Date: Tue, 13 Feb 2018 20:15:09 +0100 From: Willy Tarreau To: Andy Shevchenko Cc: Miguel Ojeda , Geert Uytterhoeven , linux-kernel , Robert Abel Subject: Re: [PATCH 1/3] auxdisplay: charlcd: fix hex literal ranges for graphics command Message-ID: <20180213191509.GB20354@1wt.eu> References: <20180209235012.4993-1-rabel@robertabel.eu> <20180209235012.4993-2-rabel@robertabel.eu> <20180210092003.GA20377@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 13, 2018 at 03:36:45PM +0200, Andy Shevchenko wrote: > On Sat, Feb 10, 2018 at 11:41 AM, Miguel Ojeda > wrote: > > On Sat, Feb 10, 2018 at 10:20 AM, Willy Tarreau 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 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? It's always the same, nobody knows that some code appeared somewhere to solve some problem they already solved a long time ago and that they are not even aware of anymore. That's why code cleanups like this session are useful. > For, I dare to say, ages we have hex_to_bin() and hex2bin(). > Can we use it? I definitely think so after taking a quick look at hex2bin(). Thanks! Willy