From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B47B5C06510 for ; Tue, 2 Jul 2019 09:08:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9237320663 for ; Tue, 2 Jul 2019 09:08:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727130AbfGBJIG (ORCPT ); Tue, 2 Jul 2019 05:08:06 -0400 Received: from gofer.mess.org ([88.97.38.141]:39455 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbfGBJIG (ORCPT ); Tue, 2 Jul 2019 05:08:06 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id F36C260A67; Tue, 2 Jul 2019 10:08:04 +0100 (BST) Date: Tue, 2 Jul 2019 10:08:04 +0100 From: Sean Young To: Bastien Nocera Cc: linux-media@vger.kernel.org Subject: Re: [PATCH 2/2] keytable: Remove comments before processing keymaps Message-ID: <20190702090804.lhxll6g7l6bdlmll@gofer.mess.org> References: <20190701163813.25032-1-hadess@hadess.net> <20190701163813.25032-2-hadess@hadess.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190701163813.25032-2-hadess@hadess.net> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Mon, Jul 01, 2019 at 06:38:13PM +0200, Bastien Nocera wrote: > Do our best to remove comments from each line we process from the keymap > sources, so as to avoid commented duplicates and false positives > sneaking in to the keymap definitions. > > Signed-off-by: Bastien Nocera > --- > utils/keytable/gen_keytables.pl | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/utils/keytable/gen_keytables.pl b/utils/keytable/gen_keytables.pl > index 3dc74ba6..d73daf58 100755 > --- a/utils/keytable/gen_keytables.pl > +++ b/utils/keytable/gen_keytables.pl > @@ -138,6 +138,9 @@ sub parse_file($$) > } > > if ($read) { > + # Remove comments > + ~ s#/\*.*?\*/##sg; > + ~ s#.*\*/##sg; This doesn't solve the /* { 0x800ff40b, KEY_ENTER }, not used */ case. Or // comments. > if (m/(0x[\dA-Fa-f]+)[\s\,]+(KEY|BTN)(\_[^\s\,\}]+)/) { > $out .= "$1 = \"$2$3\"\n"; > next; > -- > 2.21.0