From patchwork Fri Nov 18 01:22:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 22020 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp721074wrr; Thu, 17 Nov 2022 17:30:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf5TlA3GCy3X12u2AQwBGL++jhSDnbr0MoI98M4wt3FQBa/gJTW62oc4vTfzbjChOR8TU76Q X-Received: by 2002:a17:906:3289:b0:78d:4cb3:f65d with SMTP id 9-20020a170906328900b0078d4cb3f65dmr4321426ejw.79.1668735029221; Thu, 17 Nov 2022 17:30:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668735029; cv=none; d=google.com; s=arc-20160816; b=Pko9iJPlrV+lMb48yxNLrtmEQZnM7sPaj7eNcS63GmiSur2loFTiccR67LlS8qvNC2 LZmHDhMbKw87j91YxjzQMC4Q1/33W/+Ts4/THrBxsudhwDkiMAkjZliYapyUcO3oh+P8 CW5zphNm4ttzgRFpCCZNJBFSGl4jtTxRPWNhKbx7ZNGLMRYQJnf4CX+KjKjigv+PEohR 6sHpLxqixrROS8OxxIYkJ+nnVZosxlOtB8IV+upaxzHzBp89iAH7VgR+EGgCWcOzBgkH Dh2D2JkItvA7uPcibyNTPr019nz6iaMm5hLsvucPNnkvOJXf9YPxEHPF4e/J+LwnNHa+ MI/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-transfer-encoding :content-disposition:mime-version:mail-followup-to:message-id :subject:cc:to:from:date; bh=Y6Nh6UAGaYrTZqfq3cyoQkItpofzhX6Gg16gkdu3NDU=; b=f+fgVD13oVsgnkm+SjLdUFRTTNzEN+iyS6/3zX3GnIC0D444bvddKQNvBQngJSKNDY BPkrKlznlfnpy1lcA/CKGs2IkTGzUKNt8rxLN8N69lV2RFvyPP8cLk23U/QZ83oRyEfj eHj8amYZR4NSlavV2MufVMgpWK1HcVMvfzTWyO9SaefW6UNlVLXj3GRVmDMQR5o9Qw6a qYqTS2sxhqhCjjgL/xaZ79SRowPGEol5d2a4EnHaX5R0NsIqGTDJy6l90vRQWnIB7M2c y578cDgSh+d36/vfaOenfG8V63eaj/nj1wAubUu8jEEYY8gIvfkW98JBtKx5SMSGJk+F LtCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a05640227d100b004663240e1f7si2264345ede.620.2022.11.17.17.30.05; Thu, 17 Nov 2022 17:30:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235080AbiKRBWL (ORCPT + 99 others); Thu, 17 Nov 2022 20:22:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbiKRBWK (ORCPT ); Thu, 17 Nov 2022 20:22:10 -0500 Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22B566BDF9 for ; Thu, 17 Nov 2022 17:22:09 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id A624A2012C; Fri, 18 Nov 2022 02:22:07 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1NwpyYRF_7Nn; Fri, 18 Nov 2022 02:22:07 +0100 (CET) Received: from begin (lfbn-bor-1-376-208.w109-215.abo.wanadoo.fr [109.215.91.208]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 020D62011C; Fri, 18 Nov 2022 02:22:06 +0100 (CET) Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1ovq50-005R3b-1q; Fri, 18 Nov 2022 02:22:06 +0100 Date: Fri, 18 Nov 2022 02:22:06 +0100 From: Samuel Thibault To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, speakup@linux-speakup.org Subject: [PATCH] speakup: Fix building as extmod Message-ID: <20221118012206.j6hq6b6nfx2jhqg6@begin> Mail-Followup-To: Samuel Thibault , gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, speakup@linux-speakup.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749795501970036210?= X-GMAIL-MSGID: =?utf-8?q?1749795501970036210?= spk_priv_keyinfo.h should be opened from the speakup directory. When building as extmod we should thus open it from the module directory rather than the main Linux source. Signed-off-by: Samuel Thibault  --- drivers/accessibility/speakup/Makefile | 4 +++- drivers/accessibility/speakup/makemapdata.c | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) --- a/drivers/accessibility/speakup/Makefile +++ b/drivers/accessibility/speakup/Makefile @@ -40,7 +40,9 @@ hostprogs += makemapdata makemapdata-objs := makemapdata.o quiet_cmd_mkmap = MKMAP $@ - cmd_mkmap = TOPDIR=$(srctree) $(obj)/makemapdata > $@ + cmd_mkmap = TOPDIR=$(srctree) \ + SPKDIR=$(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD),$(srctree)/drivers/accessibility/speakup) \ + $(obj)/makemapdata > $@ $(obj)/mapdata.h: $(obj)/makemapdata $(call cmd,mkmap) --- a/drivers/accessibility/speakup/makemapdata.c +++ b/drivers/accessibility/speakup/makemapdata.c @@ -51,12 +51,15 @@ main(int argc, char *argv[]) { int value, i; struct st_key *this; - const char *dir_name; + const char *dir_name, *spk_dir_name; char *cp; dir_name = getenv("TOPDIR"); if (!dir_name) dir_name = "."; + spk_dir_name = getenv("SPKDIR"); + if (!spk_dir_name) + spk_dir_name = "drivers/accessibility/speakup"; bzero(key_table, sizeof(key_table)); add_key("shift", 1, is_shift); add_key("altgr", 2, is_shift); @@ -83,7 +86,7 @@ main(int argc, char *argv[]) add_key(def_name, value, is_input); } - open_input(dir_name, "drivers/accessibility/speakup/spk_priv_keyinfo.h"); + open_input(spk_dir_name, "spk_priv_keyinfo.h"); while (get_define()) { if (strlen(def_val) > 5) { //if (def_val[0] == '(')