From patchwork Fri Feb 2 15:58:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 195912 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp523120dyc; Fri, 2 Feb 2024 08:01:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMyYmI+qlcCjp2zqsufIlCyur4JO3Z1jdwz7XCaCpaGfClffjGJm1DmpIxM5khjkwvU3V+ X-Received: by 2002:a05:6214:486:b0:68c:385b:ac93 with SMTP id pt6-20020a056214048600b0068c385bac93mr7373508qvb.59.1706889668354; Fri, 02 Feb 2024 08:01:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706889668; cv=pass; d=google.com; s=arc-20160816; b=FFuUKKhDIBT8MT1Wb4ymsAgH5P36f3e7SDUpbBSezSx9CsH/xstdLxKJMtzUkIAX78 MJdhCqP4JOtD8o/L+kDkHKUxZmJXAcZ+yXLf5PSPT44OxEnHaKIvCIm+ncT7CwXWTmAg Nq8RXr/rf+nWdM1b9gXk5BaZMsZYFYmzO+wpJ19O/2dB7Kao0mw8ovwTWgBTAY448fP4 ThT988enY/rF6I/dCoBNDgmr+peduTHUoz8RFrqXqbsTTqtuTv66MKG8kteheGh/gqm9 /J9VUSRWWo2cpNUxCwuy5AWWCjfZBMYzSg+1ayEiCvp4h8w7B6eE/rkbtY+25XHWSuEV FxXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bPZRnTJl96mKmIqsUkvzfJ1PLleDwTTXwypwCroKTgM=; fh=aP+utUWnRbh+gGD8hGSCe48QI4Bm3gyUJGyMTIY4NvI=; b=SkYRBecPrciqGBB44y9IUQJz3/t7njyF/JkY40O8zHsez/WEI114jNE2rWsrjIqqNE KI6A5JK9LWXVLfZLy5T7ZMR1tqbD0oa8Lwd7whSOzVA6y9NkodagZJqDwMHYJSHOJTk0 kzgyXwM0RNah9kiXN8uXCUmyYpzir4LwuI0WQOs7sV2PHT6j8muIoDlSr2jAEJXirt54 PMlP6ukw5Bc6uf3s0lBmC9ZlmWSJceUahMvGPJWUmijLnR0Gm4UW/mumHdA2k0/nV6xS E6LHygPVmyYeu3tow/IvfHBLX3Arql1cH+kWbVuzQsZFLmT9P1iSUSg7lDgdmk7L7YAN 7VAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pnIkimcj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50066-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50066-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWIdZb7SZu13CUrTZ6DYJudocH1SLOelqQh00hyyvFEWFXIsP4bRHeTkFYs30/Nu4ypLMp/oe9vyFZsx3MhaXvcVN+ifg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t22-20020a05620a0b1600b007832fdba75asi2348028qkg.356.2024.02.02.08.01.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 08:01:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50066-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pnIkimcj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50066-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50066-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 297D11C22F23 for ; Fri, 2 Feb 2024 16:01:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7785914A0BF; Fri, 2 Feb 2024 15:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pnIkimcj" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A79C314830D; Fri, 2 Feb 2024 15:58:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706889517; cv=none; b=AnawPIoGxsLCPtf2eiLbE7V6jv8kOOm4eLmb90OBzVZtT+uSiWVvDtsUdJyKPXOjKqq41RIoIvmI5g6a/f2rOb/cpWfIp9l1comQrpapX1Olrm4xyOSnojY7MGA7MayuZi1OVeN3w+qIi+BrehBkfbUwzpkCV6x3hKD8HJye6VA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706889517; c=relaxed/simple; bh=/e+y+eilKt3GBjvzu+Sekt9FhDg+Vd4BKzKbrcOkrYI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VcKz+5i0vKCbmswHxq7Aw3QN/4fxepBBZ9dcyfXhZC6K1bwNl7Kx16TVHBCYbdc+okAtaNILV85mSTY+haVfYcz5e+iDTwkoLgyeNNMR528qfzkk8yWfo4LoNyTH8AXRGoD0WCumq9ekLpJnxv0Gnb1No9ZjktxCHcWZ3eGEY4I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pnIkimcj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84531C43390; Fri, 2 Feb 2024 15:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706889517; bh=/e+y+eilKt3GBjvzu+Sekt9FhDg+Vd4BKzKbrcOkrYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pnIkimcj7yXLKIMbA2EwdXN2Gjp4jGovzk46bpMGsxBm8+RYhxONTJM2iLqPQfJ9J Rh39I2hn/xjT2KgHvlXmkbz/wBgpRgNwjzOC1qBag6Y44QNd4wMW/sOWMQSDc91mlH Q260z921WkCeN2y0x1rmh+Vk/lRymcY3TAV/VK4/3l1lYDIGb9TOesWQ1Vjj79mgHw Y5+bo2k8bNEeuWiVP42+r4ULgd120vKnqNj7KYPUtIATBS2/JKPFQLvj6lW6/xab57 GqLhkJKagNVO2OYkNBJMXtyFJRD9LtcXs8/UNYitsw6XLHVDo3klUIeNZS/G0y6Z5k WvRts7dICAfzA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 06/27] kconfig: write Kconfig files to autoconf.cmd in order Date: Sat, 3 Feb 2024 00:58:04 +0900 Message-Id: <20240202155825.314567-7-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240202155825.314567-1-masahiroy@kernel.org> References: <20240202155825.314567-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789803540637599274 X-GMAIL-MSGID: 1789803540637599274 Currently, include/config/autoconf.cmd saves included Kconfig files in reverse order. While this is not a big deal, it is inconsistent with other *.cmd files generated by fixdep. Output the included Kconfig files in the included order. Signed-off-by: Masahiro Yamada --- scripts/kconfig/confdata.c | 7 +++---- scripts/kconfig/lkc.h | 1 + scripts/kconfig/parser.y | 4 ++++ scripts/kconfig/util.c | 3 +++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 7f0aa39b68c1..f6a96fdddb7e 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -20,6 +20,8 @@ #include "lkc.h" +struct gstr autoconf_cmd; + /* return true if 'path' exists, false otherwise */ static bool is_present(const char *path) { @@ -972,7 +974,6 @@ int conf_write(const char *name) static int conf_write_autoconf_cmd(const char *autoconf_name) { char name[PATH_MAX], tmp[PATH_MAX]; - struct file *file; FILE *out; int ret; @@ -993,9 +994,7 @@ static int conf_write_autoconf_cmd(const char *autoconf_name) return -1; } - fprintf(out, "deps_config := \\\n"); - for (file = file_list; file; file = file->next) - fprintf(out, "\t%s \\\n", file->name); + fputs(str_get(&autoconf_cmd), out); fprintf(out, "\n%s: $(deps_config)\n\n", autoconf_name); diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 5cdc8f5e6446..8616ad83be6d 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -40,6 +40,7 @@ int zconf_lineno(void); const char *zconf_curname(void); /* confdata.c */ +extern struct gstr autoconf_cmd; const char *conf_get_configname(void); void set_all_choice_values(struct symbol *csym); diff --git a/scripts/kconfig/parser.y b/scripts/kconfig/parser.y index 625224973c51..611038c502fc 100644 --- a/scripts/kconfig/parser.y +++ b/scripts/kconfig/parser.y @@ -480,6 +480,10 @@ void conf_parse(const char *name) struct symbol *sym; int i; + autoconf_cmd = str_new(); + + str_printf(&autoconf_cmd, "deps_config := \\\n"); + zconf_initscan(name); _menu_init(); diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index 92e5b2b9761d..958543bb0a37 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c @@ -25,6 +25,9 @@ struct file *file_lookup(const char *name) file->name = xstrdup(name); file->next = file_list; file_list = file; + + str_printf(&autoconf_cmd, "\t%s \\\n", name); + return file; }