Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp531286pxb; Tue, 15 Feb 2022 21:03:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJydSNwoUd0hPfCKLWnSsGFYXZ0nUcqF/BIqPDA68QX0/d9/xEDt8vGVgHwoqc2s8GLWs+Or X-Received: by 2002:a17:90a:a117:b0:1b9:65ef:fa64 with SMTP id s23-20020a17090aa11700b001b965effa64mr982353pjp.102.1644987835766; Tue, 15 Feb 2022 21:03:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644987835; cv=none; d=google.com; s=arc-20160816; b=R2DRNVRn96A4FQlAujrLgqgOTz/YmwDZR7wSyPJYJinnFLh6Ih3um7f0zMtkyTdiOe rSFx9MDdAVglSjkwM8QMMnk1dw+V1mKfhyyCw8wMNSJ/t7zrewXJ7pBnSZQACjXULdq8 kVTO38TEjb+hjutVAG0ewvj3j0n60u5qA3g5toJipj2mnNxt57x0krZaihD9vdPDRx/Y fW3VYfgIVEkTwHnVUja9hwcLkBkfDb4sIlKWD6LhFuelygIYRnPbQ3/JuBK/DT3vRCnz YzCfrvha8szWnsI0zWZ2fnr1q52m1AZNRfgeUCV/1uMyZDJ9IG9BQ8l6Eec4Q3eGtJ0y 2s1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OKPWhbeX+2XZnEW0obcZcsv6FNZgEQmP+tghXdA5Q4Y=; b=UcRaOl/nMMRf8CXIxfFe9Ud2heQVI7ggZ6y0LSq333xs+GBbmEYQHEidB/IKd2oGV6 37oa28lYqCveRrOWjIFqHzT4unGowaow/A9cFo8mGx8K6Jd0HoCV4CWXMWVMUd/S2JtY ENDyGuOqs5NLoNOne2VZ2gmF18VS423eP4ybILxUgQLxNjL+nozUOr00MYN/Grklg1ZK lPneaiVfXxGoP0INFQfx/qFaESdbi3vl3lhqZkiuvO/jW+XpsuS0/SesWe7Tzc6conid lwAQs9G0mV8jq2oipr+vMpaJtn2sD4llgRUH7aJqa9/mUxKtIdolX3Nq64F/M1vmudgH B9uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="vA1Ctg/H"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id np8si5915916pjb.174.2022.02.15.21.03.38; Tue, 15 Feb 2022 21:03:55 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="vA1Ctg/H"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240699AbiBOPf1 (ORCPT + 99 others); Tue, 15 Feb 2022 10:35:27 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240573AbiBOPe0 (ORCPT ); Tue, 15 Feb 2022 10:34:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4960EB2D58; Tue, 15 Feb 2022 07:30:39 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F126AB81AFB; Tue, 15 Feb 2022 15:30:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D044BC36AE3; Tue, 15 Feb 2022 15:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644939036; bh=Iu10TYzWNrgXeQsfppIYu11B1WF3/PSnjsNid03wlWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vA1Ctg/H3y1SdLqJc9Js6J6CwPUWcWDPv+nMir21AiV1BnsX3TrEm9TIPmBlZifbh WMz5LEy36j0KY3q/eUOcvIpFUUbme5MpTX54riJP38IHKgIIp09CNhVCQnEpbNkL9F aC/V7Cn4U9ZULiZp7x7Tmv2o+KdeRXpYBZxWn9nL+eYpXiMZL9jTIPHUTBbl6EXlaC 5yFa+ir+WVG4SCDBBAtKe0Bl1yU5xi6zEVWIfuEDHpxd6vLR9MWYTvpE0XNooJKBDc AlK0VwkPWfuIEDVKket8apWBZgOG8FHB6QSKEAhquRXTNiPJ1XqR7c8c9286yJwgp9 fPaqekrh8Fa4w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jing Leng , Masahiro Yamada , Sasha Levin , linux-kbuild@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 23/23] kconfig: fix failing to generate auto.conf Date: Tue, 15 Feb 2022 10:29:57 -0500 Message-Id: <20220215152957.581303-23-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215152957.581303-1-sashal@kernel.org> References: <20220215152957.581303-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Jing Leng [ Upstream commit 1b9e740a81f91ae338b29ed70455719804957b80 ] When the KCONFIG_AUTOCONFIG is specified (e.g. export \ KCONFIG_AUTOCONFIG=output/config/auto.conf), the directory of include/config/ will not be created, so kconfig can't create deps files in it and auto.conf can't be generated. Signed-off-by: Jing Leng Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/kconfig/confdata.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index a39d93e3c6ae8..867b06c6d2797 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -968,14 +968,19 @@ static int conf_write_dep(const char *name) static int conf_touch_deps(void) { - const char *name; + const char *name, *tmp; struct symbol *sym; int res, i; - strcpy(depfile_path, "include/config/"); - depfile_prefix_len = strlen(depfile_path); - name = conf_get_autoconfig_name(); + tmp = strrchr(name, '/'); + depfile_prefix_len = tmp ? tmp - name + 1 : 0; + if (depfile_prefix_len + 1 > sizeof(depfile_path)) + return -1; + + strncpy(depfile_path, name, depfile_prefix_len); + depfile_path[depfile_prefix_len] = 0; + conf_read_simple(name, S_DEF_AUTO); sym_calc_value(modules_sym); -- 2.34.1