Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2884412rwb; Thu, 17 Nov 2022 18:14:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7gtuFnFcmDj9b0DOyboeyWDad2IARqgCc1625qyJoVRey8GaH9qbHNke2D1Iay0OmmIM+I X-Received: by 2002:a17:906:d7ae:b0:78d:9325:55b5 with SMTP id pk14-20020a170906d7ae00b0078d932555b5mr4239588ejb.618.1668737685269; Thu, 17 Nov 2022 18:14:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668737685; cv=none; d=google.com; s=arc-20160816; b=xoc2fANmHJhfOiCDSvz6NkBRUM1+jbejdUmapNLbTgC2w6toS1DV1NBaBbgLbg0cq7 rDRny5eIvhrev45cND/PHBVoEnqZuEsQdbnCJXe7K1lssf6nOJuNYEwYMyy0HDFPmCqs pmcmBjfbbcNVsiwT2Cxs/fWn5zkWUHHjEaGA5U4xxRJEXktZb35ZzHCSGD8f38SE/ocI 1Ga1I5VeKYk0GVuLEtFsjbC5FaL9UlVXxetFAZ3OaQ/VFagEiM6elWJ1AFdJFOw/wmC0 7+E5fD7FGJilPNVg3KJFwD/sEHzsvh0tJERF9mbRv28d+dhWhReMWMJalZTg3R31oN+q me4Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x9-20020a05640226c900b00461c9bb5205si2429372edd.152.2022.11.17.18.14.21; Thu, 17 Nov 2022 18:14:45 -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 + 91 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-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 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] == '(')