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=-9.7 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_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 F39CBC33CB7 for ; Wed, 29 Jan 2020 11:54:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC8592071E for ; Wed, 29 Jan 2020 11:54:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726620AbgA2LyV (ORCPT ); Wed, 29 Jan 2020 06:54:21 -0500 Received: from gofer.mess.org ([88.97.38.141]:60379 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbgA2LyV (ORCPT ); Wed, 29 Jan 2020 06:54:21 -0500 Received: by gofer.mess.org (Postfix, from userid 1000) id AA688C6461; Wed, 29 Jan 2020 11:54:19 +0000 (GMT) From: Sean Young To: linux-media@vger.kernel.org Cc: Frank Wunderlich Subject: [PATCH v4l-utils 4/4] keytable: a bpf protocol can have parameters and no scancodes Date: Wed, 29 Jan 2020 11:54:19 +0000 Message-Id: <20200129115419.8456-5-sean@mess.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200129115419.8456-1-sean@mess.org> References: <20200129115419.8456-1-sean@mess.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Currently a protocol without scancodes does not get its parameters parsed. Signed-off-by: Sean Young --- utils/common/keymap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/utils/common/keymap.c b/utils/common/keymap.c index 15c31c76..a3c1349e 100644 --- a/utils/common/keymap.c +++ b/utils/common/keymap.c @@ -384,13 +384,6 @@ static error_t parse_toml_protocol(const char *fname, struct toml_table_t *proot return EINVAL; } - scancodes = toml_table_in(proot, "scancodes"); - if (!scancodes) { - if (verbose) - fprintf(stderr, _("%s: no [protocols.scancodes] section\n"), fname); - return 0; - } - for (i = 0; (key = toml_key_in(proot, i)) != NULL; i++) { int64_t value; @@ -408,6 +401,13 @@ static error_t parse_toml_protocol(const char *fname, struct toml_table_t *proot } } + scancodes = toml_table_in(proot, "scancodes"); + if (!scancodes) { + if (verbose) + fprintf(stderr, _("%s: no [protocols.scancodes] section\n"), fname); + return 0; + } + struct scancode_entry **next = &map->scancode; i = 0; -- 2.24.1