Received: by 10.223.185.116 with SMTP id b49csp4593wrg; Sat, 10 Feb 2018 00:59:43 -0800 (PST) X-Google-Smtp-Source: AH8x225nvIeHCRyoCgNS8io9iocBNf6n/0RM1AMAZG6Bq9c2Kmpj0TOi+znziMc/elQHUe0C4ROu X-Received: by 10.98.54.71 with SMTP id d68mr5502099pfa.173.1518253183025; Sat, 10 Feb 2018 00:59:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518253182; cv=none; d=google.com; s=arc-20160816; b=lH3mc/cjfY8h5XXdzimZjCRr0D8ODLq8Q7Czbw8jZT5LCDxqoyBCBHEeDBxBJp1L3G 6+zI0TvX/tJTnh4Jg7jijOuWqEhGA4Js9Rzrh5LrUy1j8lBiIoO6afeeqs2Zq5xEQ3oy c+NH2inGKXPQAcz5tbNVyPTlw8uyiZztb/VDfK5pLta4K1QfyfTdLasFp3L1ijcfJieX 35vZuK7w1VQ9Sd+biFglfcxUKdyauD5sGcxs7r2Ja8P/z2/2fDNpI01t3/AfWKwgdTMu gY8eouy0AkVbuzqp9m0d8XwwC+kv0qVina4J6bjCapljy9rtAp1aT3WHpviDg2iyVUO+ G8JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=aaSfEp9rFj7WSAIGiNxb2ym2pLGGe8WqiCEsDGCfLH0=; b=Y81KT5bYUHwKr+WEAGKGMQ1URIfqSutH4Zwk343XWRtH3Ot8DlKoXWmvfRazdBdqUe aFbFDvUAksHJz4qL466++aPjvMaWGMwi1scoOlKm8PceXEUPJU794cVCVcsNLWlL+cu+ bjSZ1fL5DtXzgZnAD6IVSuTJUe5F+sAeB3nHpThd3/7GOvrYigRr7+YSU2Z9m5i0bcsj mnaXqzcnAECMhjDQZ7qQhxEqbDvTDrfysAowDpNKuV59h8AYWLt8tXZgNBFGKxUtBJXa VJ0gPyk3OXsrGsXCwo+UxylWA0awSTXpTJeCWjdfblPyClHMidIJBHUIbD2dcNEyRbkG 5TSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L/em6wha; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7si87508pfh.186.2018.02.10.00.59.29; Sat, 10 Feb 2018 00:59:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L/em6wha; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751286AbeBJI6r (ORCPT + 99 others); Sat, 10 Feb 2018 03:58:47 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:39809 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750880AbeBJI6q (ORCPT ); Sat, 10 Feb 2018 03:58:46 -0500 Received: by mail-qk0-f196.google.com with SMTP id d72so12962226qkc.6 for ; Sat, 10 Feb 2018 00:58:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aaSfEp9rFj7WSAIGiNxb2ym2pLGGe8WqiCEsDGCfLH0=; b=L/em6wha3SUSiNpXZzmhGrAkeRQvDumGWCAYq3O3fLeu+uSxsS9hbJpjKUtMt+owTB L+P6NCDlxMdWmskWEvyUmAtV/Biql7Tc1qB6GTmEvxNBhlB46UkIEr9NePF2sX2SktHq fy9KluE5uqYCoWh8PzLVjV2HHLdXfnjkFoQJPSy6DAG2AxbaaseJO6ghpBn+jZtT0wQu hxLDKzO+fFWa9lFrJoyVXHt6PQSnlB7IwcjCkc8LA+FdkZ71SYYgl4wXhb6cdX8sae3Y KkwRJZuh6xTv7mEJmcm6ocS+LuCrnhJp8/5L3BhONK+EV0WvyOJrunwPp/zhLY/Vu96p VU4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aaSfEp9rFj7WSAIGiNxb2ym2pLGGe8WqiCEsDGCfLH0=; b=rPRpKVRt0WRQzCCKsab30U8tAtP9E6oZeeOe3i/57CmsWzhfzrlg3M1le8/LZI46uK 4Bbp0BngeKxPSBs2gD4g4DuciD7XLl0WyLBhbu9gfXASa5DkxUB8toTyZ+kOrsgY/OLq MfGKVtCXFK2fNP+qDQc7hIrYatOJ4uJSRnNdY24K+xTf53bdnFnAZojcKIPJvnKMTmNF ZixZ4ROxeR8gcnYTFJjlsTpmitnWScDUm+UAuISfzuuAQRq5jVaWeGHDv+YqEIJ5xeBX p1QQYnDehmgi8vu8OpLVhZiGu7s6nONN0DLWhTgCrvsXHWMQp39HcGooZdiLw+7uHp90 MHzg== X-Gm-Message-State: APf1xPBLhpaiNQYMq4Ja7e1qOus6ExEhNH5mVPJg61Ivj3teRFBIm1UC cemW/k/P7+Bfpza7tSpxFQkqLMDgt+F+iwRh3eAIA+Hg X-Received: by 10.55.148.131 with SMTP id w125mr7861313qkd.37.1518253125388; Sat, 10 Feb 2018 00:58:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.26.7 with HTTP; Sat, 10 Feb 2018 00:58:44 -0800 (PST) In-Reply-To: <20180209235012.4993-2-rabel@robertabel.eu> References: <20180209235012.4993-1-rabel@robertabel.eu> <20180209235012.4993-2-rabel@robertabel.eu> From: Miguel Ojeda Date: Sat, 10 Feb 2018 09:58:44 +0100 Message-ID: Subject: Re: [PATCH 1/3] auxdisplay: charlcd: fix hex literal ranges for graphics command To: Willy Tarreau , Geert Uytterhoeven Cc: linux-kernel , Robert Abel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 10, 2018 at 12:50 AM, Robert Abel wrote: > The graphics command expects 16 hexadecimal literals, but would allow characters in range [0-9a-zA-Z] instead of [0-9a-fA-F]. > > Signed-off-by: Robert Abel > --- > drivers/auxdisplay/charlcd.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c > index 642afd88870b..324d02f9f1c5 100644 > --- a/drivers/auxdisplay/charlcd.c > +++ b/drivers/auxdisplay/charlcd.c > @@ -441,9 +441,9 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) > 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? In that case, adding a comment to the code would be good. I found some related docs at Documentation/misc-devices/lcd-panel-cgram.txt by Willy (which, by the way, maybe now we should move them to Documentations/auxdisplay); but the paragraph does indeed say they have to be hex: ''' Some LCDs allow you to define up to 8 characters, mapped to ASCII characters 0 to 7. The escape code to define a new character is '\e[LG' followed by one digit from 0 to 7, representing the character number, and up to 8 couples of hex digits terminated by a semi-colon (';'). ''' > value |= (*esc - 'a' + 10) << shift; > } else { > esc++; > -- > 2.11.0 >