From patchwork Tue Jan 26 17:45:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastien Nocera X-Patchwork-Id: 12050021 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=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 9DC7DC433DB for ; Wed, 27 Jan 2021 12:47:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5001520882 for ; Wed, 27 Jan 2021 12:47:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S313329AbhAZWyQ (ORCPT ); Tue, 26 Jan 2021 17:54:16 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:45001 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393221AbhAZRqE (ORCPT ); Tue, 26 Jan 2021 12:46:04 -0500 X-Originating-IP: 78.199.60.242 Received: from localhost.localdomain (unknown [78.199.60.242]) (Authenticated sender: hadess@hadess.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id C6EB21BF20C; Tue, 26 Jan 2021 17:45:17 +0000 (UTC) From: Bastien Nocera To: linux-media@vger.kernel.org Cc: Bastien Nocera Subject: [PATCH] keytable: Add source information in generated keymaps Date: Tue, 26 Jan 2021 18:45:14 +0100 Message-Id: <20210126174514.1393240-1-hadess@hadess.net> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add comments to mention that keymap files are generated, and list which tool was used to generate them and the kernel source filename. This should make it less likely that generated files are used as examples to contribute keymaps from, and more likely that upstream changes are channeled through the right source tree. Signed-off-by: Bastien Nocera --- utils/keytable/gen_keytables.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/keytable/gen_keytables.pl b/utils/keytable/gen_keytables.pl index c14aded3..40556479 100755 --- a/utils/keytable/gen_keytables.pl +++ b/utils/keytable/gen_keytables.pl @@ -36,10 +36,15 @@ sub flush($$) my $filename = shift; my $legacy = shift; my $defined; + my $relative_filename = $filename; return if (!$keyname || !$out); - print "Creating $dir/$keyname.toml\n"; + $relative_filename =~ s/^$kernel_dir//; + $relative_filename =~ s/^\///; + print "Creating $dir/$keyname.toml from $relative_filename\n"; open OUT, ">$dir/$keyname.toml"; + print OUT "# Generated with gen_keytables.pl in v4l-utils\n"; + print OUT "# using $relative_filename as a source file\n"; print OUT "[[protocols]]\n"; print OUT "name = \"$keyname\"\n"; print OUT "protocol = \"$type\"\n";