Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp520691lqp; Tue, 11 Jun 2024 11:01:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU29HYMKfENQbqKW2leLynzlqohadsVKMShVpWVNoXt6SWTdHeCSQW5A3Fy/WjW8bAkhKAqgmRrUeh4GOLoqsEqevgEsrabWmXDwNd08w== X-Google-Smtp-Source: AGHT+IF2YxrqGoHH6I8OPxXtEWgCP2Z9JotS5A/CW60vzpsmukwtL4CqPI7jPKnVRoOef7FMfoV1 X-Received: by 2002:a05:6a20:a111:b0:1b8:32fd:4dd3 with SMTP id adf61e73a8af0-1b832fd523bmr5357768637.13.1718128874220; Tue, 11 Jun 2024 11:01:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718128874; cv=pass; d=google.com; s=arc-20160816; b=sP0TxvGONG5GqOvArx4f27Gan940Ec3EF893aQX/t8l+Dt0u86s6H2ohCoVktyyFK5 Huov5xgcZHznqonqRX7+3zJcASiKlicS/OwRpoL/LJn/aAKZR2tWvKKvlmH1r/NNrJpT b8fw1lnSg4S9CrpVZdjD1vWHDQg8EZ3aIEUCT8pJeTndWCGNqg0Z0poCOW3HNhyZz7TP wAgmhpgDLiFCwmBwMvIeGjmyD+Ik6/O4xjukpP61dYB3KwD7McYA2JsWjEv+Dqsjt68R C7pQ1FYV9RIGizJj3oNhDBcxrQCch+9+ZI3mPjrYqJ5/1eIGhCCARuN/95snoo6mCtea nRgw== 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=zy3WUcM6yv+uWaBUoN8PHXgh/BtQYurh6wB0mgM5YDw=; fh=oQbvuNnOUeIuBT5siQdg+euUHNNdn+CeEwAg69/1RSo=; b=SKHd0n4nf6YNBtG5G185+qNgjuXzpPs2q1DHpm+YQd4jrx+k3fd0oq3hokxclAOzJ6 ItJtIYFQivDEoUpZYn/tpoCJTrgnHsbEFMtqG8AxpOl7KJEPIBmOLHKeHoIIMRzutH7s K9G8Y0qD/aOykgsm9ql5L05X+S092YPsXWEhZnRpMfswzSy/hcCc1DRLe4RAXP6dLT5c gku4Zmc29BVXFh2Lwp9j39Zxds/3XGamRlbcVjSLTNfDYA+9FaigALDdnU2ZU+IRjX2k jRlQHtQben5PUGNicAqi0VFKfSgAAuAU6Vff4662f1bUCo+/3z2ClD6gTSIIZdHNb1EF NVGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gMtRScR+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210371-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e5d963e10dsi6141172a12.431.2024.06.11.11.01.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 11:01:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gMtRScR+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210371-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8A33A2853AA for ; Tue, 11 Jun 2024 17:58:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90F9B14F9F7; Tue, 11 Jun 2024 17:56:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gMtRScR+" 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 B865313D2B2; Tue, 11 Jun 2024 17:56:11 +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=1718128571; cv=none; b=WwTdjSn4J87Wr4+Duq/VC05ofp/9hYNg/m3dLN8MwwFVOX1bGEY5YQE5rY3g2SWL+7iIO2RrCLv9kDYz7iXck5RTPsRigtidISAQtcsVudHPETCrGJzGOSyfk+MIvtmzk/xghuSrFCCu8ufR6Mj+O017xHE6lTW6ypdHr3TZMBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718128571; c=relaxed/simple; bh=+/lE6+H5ABqs4SlKsAZy4Du0516Zahbwztxm4gigQf0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PIA1POxKptwrfQiZ8izZirLXWhxrtXqfgRAU7cCOQeFHhSgVp4TAqbc+J5Rg4649h+Cx6PCuFsjEEoaRM/zLDmfz4dB5wnjc5xcw3ATRLBRzexCRVdJv73GVOeiWxjOgV2nMbndc9ZS3paV5E443etLnyRyRiHvwzrwWVEEtsOA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gMtRScR+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D65AFC4AF48; Tue, 11 Jun 2024 17:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718128571; bh=+/lE6+H5ABqs4SlKsAZy4Du0516Zahbwztxm4gigQf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gMtRScR+8VyEbauMWoAq2hIGK3K34VVmzRlq04OffhN5gfrz4+ILW4zoxgvXMNxYZ zpW0I2CdLX+v/35a3o9ZOIjWFsKLeR7ZvMHfzoticck8nxqzV6ARvS36mn+WUpZ4bz xTVx/UgOrlpgCFwlVIDC9WvPwH533VNRNb10B6AVFlJRKvStd/wvpFghG1djmOLvOf TFv5qoEnZyWYe4du04ZGtqHAoKOpm+z/Dd/FXPrIxbuX5D1yQIylHAjTNORH/m3GRX hxO4HEAwV+ym6bXuzI9K8kupk459+r12izcbgmUpiZu0Gz4FG3j64VnFsUgMGFhUEY IZPknyhbEcOXg== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 09/16] kconfig: change sym_choice_default() to take the choice menu Date: Wed, 12 Jun 2024 02:55:18 +0900 Message-ID: <20240611175536.3518179-10-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240611175536.3518179-1-masahiroy@kernel.org> References: <20240611175536.3518179-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Change the argument of sym_choice_default() to ease further cleanups. Signed-off-by: Masahiro Yamada --- scripts/kconfig/confdata.c | 2 +- scripts/kconfig/lkc.h | 2 +- scripts/kconfig/symbol.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 4359fbc9255b..76193ce5a792 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -779,7 +779,7 @@ int conf_write_defconfig(const char *filename) if (choice) { struct symbol *ds; - ds = sym_choice_default(choice->sym); + ds = sym_choice_default(choice); if (sym == ds && sym_get_tristate_value(sym) == yes) continue; } diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index d820272a85fb..586a5e11f51e 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -109,7 +109,7 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help); /* symbol.c */ void sym_clear_all_valid(void); -struct symbol *sym_choice_default(struct symbol *sym); +struct symbol *sym_choice_default(struct menu *choice); struct symbol *sym_calc_choice(struct menu *choice); struct property *sym_get_range_prop(struct symbol *sym); const char *sym_get_string_default(struct symbol *sym); diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index b2fdae15f367..32c80a29dcd4 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -255,14 +255,14 @@ static void sym_calc_visibility(struct symbol *sym) * Next locate the first visible choice value * Return NULL if none was found */ -struct symbol *sym_choice_default(struct symbol *sym) +struct symbol *sym_choice_default(struct menu *choice) { struct symbol *def_sym; struct property *prop; struct expr *e; /* any of the defaults visible? */ - for_all_defaults(sym, prop) { + for_all_defaults(choice->sym, prop) { prop->visible.tri = expr_calc_value(prop->visible.expr); if (prop->visible.tri == no) continue; @@ -272,7 +272,7 @@ struct symbol *sym_choice_default(struct symbol *sym) } /* just get the first visible value */ - prop = sym_get_choice_prop(sym); + prop = sym_get_choice_prop(choice->sym); expr_list_for_each_sym(prop->expr, e, def_sym) if (def_sym->visible != no) return def_sym; @@ -309,7 +309,7 @@ struct symbol *sym_calc_choice(struct menu *choice) /* If 'y' is not found in the user input, try the default */ if (!res) { - res = sym_choice_default(choice->sym); + res = sym_choice_default(choice); if (res && sym_has_value(res) && res->def[S_DEF_USER].tri == no) res = NULL; } -- 2.43.0