Received: by 10.223.185.116 with SMTP id b49csp446811wrg; Sat, 10 Feb 2018 10:34:15 -0800 (PST) X-Google-Smtp-Source: AH8x226UhHSBDjjmurMr0sqsIcadrgXXGRMFZwCfUxl2JsbD6Juj15lIJ0vx08RffnN7Cqo5FxH2 X-Received: by 10.101.91.140 with SMTP id i12mr5360468pgr.297.1518287655435; Sat, 10 Feb 2018 10:34:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518287655; cv=none; d=google.com; s=arc-20160816; b=aZbp7+XIJkU3YfvABNLabX6J0XrGwZL7QeCJnNYNUjT3xV2yKDJ9KnaJUi78zpRE3H E8Vd8mAAd3DHAP5yBw+FYUpKya7eC5yhK5BYOGTtiBFXkxc/jPo9WqpexE4iGW8HNPUy BYdSVCWC8Tp6c8bXIXZQdcf+niDnHL/5LZr4Xdtg6XYgf4zOEBrsBxs8ygjdSiBya7h9 w4L/dXk9UAvTT0Yf9ZLX4YUzgqM1I38HfqQBYH+V0mdi5Mp5PdFhBfe5Ko3AoMS0qZcp nfPpAxdy8C99WWKDpy3Tn2MPDA7C7Wel2U6vYWAGaJC01WCup/bYeifJfsGJ6PKGEH3W 27mg== 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=RNnsClWIzak8e0sMk+d6ha+TGMwd9mV4TSIyeuhN++k=; b=P1BFSdLNfUgO+q0dO1LbXS7SYKG42sc03oEwzRMTQilpLrQYVYzuGlwr/T86avVXmJ tB5opmsA9BhnWItm31XrEuslGy8sUXq3dj8GWnsus300l2toE6AhNSK9h5kUygytDIBs DOwGB7UJEyP8vJXp3TMQ10cObYvvKrZbPglaJQVVxNdC8UR88SWiCyJcQe+wAoEbg2rO xL4mcSIa7eJA9DiUQfdG7q5e1ZE3hVudcW1FYX1Ddtt1pqH0GoKrORDwW6U2unejSnKu 3GR6ub0O/YcsgTTHVKlQrTFJl8yfPMYNOHQ6HQTJnWLD0Rk5eYA0VPRzjzPX4WWfwGQR 7NyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=APj14rqR; 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 b6-v6si3295501plx.805.2018.02.10.10.34.01; Sat, 10 Feb 2018 10:34:15 -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=fail header.i=@gmail.com header.s=20161025 header.b=APj14rqR; 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 S1752058AbeBJSb4 (ORCPT + 99 others); Sat, 10 Feb 2018 13:31:56 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:42138 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751756AbeBJSbz (ORCPT ); Sat, 10 Feb 2018 13:31:55 -0500 Received: by mail-qt0-f193.google.com with SMTP id i8so14519259qtj.9 for ; Sat, 10 Feb 2018 10:31:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=RNnsClWIzak8e0sMk+d6ha+TGMwd9mV4TSIyeuhN++k=; b=APj14rqREcIwPWJttgCg61moWi1nz7asysEg+BG1zja/HxVdeFP9+q+IisX96C92X5 44CxhOWn+csE8eYIHmkH1lGSl3z1mOPm3aJXU/+DyL48j7CRpT5DtNlpH5fRzKI1deVr vp0u5GHo1MEiHM5+SoBt4hYfAj9NkxqO5PXjGUogg80Hcrq4t1PpWkRiluLgEX9Kuf0/ XU4t8Hitghcvgh8cYeUQSp/nm4KENedHU2jEhDHK55xv3a4YqxUtC86i5kFcPSBzrdoP LcrVivRfHdRMAp9H0gheWwgsT54ghH+cfjHT2HQ9u0ZlDbm4LWYa/Bu7GQ8/8b8jeRNE 7XGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=RNnsClWIzak8e0sMk+d6ha+TGMwd9mV4TSIyeuhN++k=; b=ZoL+4OgiGMiDy+TBfI7tcIIbYBd3EDR1xZyolilPCXduaZaYtSJ15GErAgbaxi6RPj a9jejpdhyUzgfJErsYYe+Lcl3RazInhpqtxKbAYJcdU67ag+reLmpuYsx9kwSOg5WkMM +PwLTsHp35+iQZX5dSlcdYQv4GfKZ34Qj6aIa1jG0Ha+8WehbrfqXE5VhgWBJWCj8lgi 6yN7mBI6Sfzjt53DCPHAuIaa9G3NHbB+WMEBaL1elDvp0vAhIpytfZp6z9NT1DTY/qNw 2PFVPBavGy1dAQJanorxMwvKlKwmO5C6fDMkUzb53XKnZ07X66DcsmkVwOnB6yNHvn4G Eu9A== X-Gm-Message-State: APf1xPDx+cdVwVmbS9UWwtYU1SRTOET4Nt+3qmfazSy2YtADVRrQH+bo gz1gWIGGPiCNN4PNhKLBR24+ZmLoGiRtPveMoraJ2xw4 X-Received: by 10.237.44.230 with SMTP id g93mr11010881qtd.274.1518287514591; Sat, 10 Feb 2018 10:31:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.39.197 with HTTP; Sat, 10 Feb 2018 10:31:54 -0800 (PST) In-Reply-To: References: <20180209235012.4993-1-rabel@robertabel.eu> <20180209235012.4993-2-rabel@robertabel.eu> From: Geert Uytterhoeven Date: Sat, 10 Feb 2018 19:31:54 +0100 X-Google-Sender-Auth: q7ZAMCunlZjKvse2NWbQhaL3WBw Message-ID: Subject: Re: [PATCH 1/3] auxdisplay: charlcd: fix hex literal ranges for graphics command To: Miguel Ojeda Cc: Willy Tarreau , 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 9:58 AM, Miguel Ojeda wrote: > 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 Reviewed-by: Geert Uytterhoeven >> --- 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 > (';'). > ''' Hadn't noticed this before. Probably a stupid thinko, as Willy said. The redefinition feature definitely works with hex characters. I've used it in the past, cfr. the picture on my Google+ profile ;-) https://plus.google.com/u/0/+GeertUytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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