Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1162134lqg; Sat, 2 Mar 2024 20:00:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWdVscByDqnBYYgA3kb7s3axYVLY+Stn0voj0wn199CL/LL4W3o4njs+l2YzT9FeGiP8z2RO8QLQA/1AMk/xBIEqCRywJMaEhdKSph5Dw== X-Google-Smtp-Source: AGHT+IF5ETiXwrLwGszqLTJxLZVHjsyuLsVea1j72QKy7N+oD27xH1uLqXaLJ72cjvGlGt0/EyQR X-Received: by 2002:a05:6402:1a4d:b0:565:7bca:eebf with SMTP id bf13-20020a0564021a4d00b005657bcaeebfmr4199160edb.14.1709438457435; Sat, 02 Mar 2024 20:00:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709438457; cv=pass; d=google.com; s=arc-20160816; b=ZyNoMi/7I8lN19nCXpYmiCSVcsGu7Hy6BxZ9OK4s9DyJTVRm7eXV6jl2mqMNsMpm7l GugOLylfusTZznrQ7iJZvEAuzJYmGp7pORQOMqgLqPse6MSS9WN/s2dxW+2m5m1MD55e W2sZ8KHyoRkeSNzO/ADve1WlWJqT/zn5DeNtidfqQtDtFZaPX/xi+5V/UtVvYS8RL4PC KemePlXD6gyErN8DUw/ZpcZkfnUQekLpquIJuVh+OQds+C+iurfLyNp2CbIle8MhtB4i k4i07RZBpqSXexV3yeoua3vKqs8gaRKMYiq5wqYI8tcr57yau1KZl+JVUzSi1GugajWE 47lQ== 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=IQEr3SL+XevAoOOk/ARLWph+tBP8TFNlpPLwubvoeuk=; fh=oQbvuNnOUeIuBT5siQdg+euUHNNdn+CeEwAg69/1RSo=; b=Nhi81Uw20YRPwEH0/CHJzPbMOdUyoRTrbRrLuGIyBUwmBeAbVKeD6eAacipEgHNcTj zMiQjkxnLS1jlVEZ/W5xvJZhvckBql4XMwQKWdXLFnTys/LImCmuoUnsLKZY5c6oFuYX 7CfADu460u7rYWHgw8Uxos4cHXtmyt5/FvII2neznjCzs9JOfxLx8NTsh9Af5efznpK7 +PRhpfkfw4hIZp7ltrKT0MCUe4H/E76rSaXyQqY+AunjwTtgrf9schDo4DeNd0DquTSI 8mWPbP1vyeve122FAPJtf+T4iD563oEICBX9c9aA3L0FYGUBF2bmIySHcRyjzRPMxImN Hh6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dh6b+igi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-89648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j20-20020a508a94000000b00566b495eefcsi2405060edj.562.2024.03.02.20.00.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 20:00:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dh6b+igi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-89648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89648-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2EFE81F21D1A for ; Sun, 3 Mar 2024 04:00:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D65538473; Sun, 3 Mar 2024 04:00:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dh6b+igi" 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 0776E6FD0; Sun, 3 Mar 2024 04:00:41 +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=1709438442; cv=none; b=G5lT7wY7OCdqo0pBWopFqqtoSTbqmhL814HSfsbI3gmnBs0kDbvhP9o1bDNw09b4lD0M32pS/b4tUsvjShFkFYNB7Q9cQfQuQ9YS8jaajO2y1Hg/KPtrv4jPFdb5cmPAvcx9gqUNpxPHWEtitBkTZR6QlV3aAuURnlfvyaog+kU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709438442; c=relaxed/simple; bh=lXxv7xJWAlJqvQFRnp9M3lrdj0gJLvlnbtl717FZbxs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ws9+yfcHdEN4gCl8QSiONwaqWLZaqzmzeOGoPMn4sXBMxB3idnBnIVQRqVqReSIPWwFiAqtqxTiPSTSHFLMM1MTZm0r4926hIjLdDs6yxYGxpJwrnXLA392enZbrZ7MPqp/FIriIwB6JB/2JMQxdNaooZXr2ufVplylzsUfDdlo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dh6b+igi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95DA0C43390; Sun, 3 Mar 2024 04:00:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709438441; bh=lXxv7xJWAlJqvQFRnp9M3lrdj0gJLvlnbtl717FZbxs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dh6b+igiB4aTOI/O9SivESZbD0SWWk1mtZ1L2TB6N2TI3XDc4hANH0sF17JsujD1E ZtIeIHk2Xf7zSdIMu2BJwVgLXoFn9XrrykXk7Tt4PNGUqvW1Xngj7AvPnuQ+3EJ60S +CbH1k11Sr2fWB8GQHaNHGN+UVbbMeShUlD3aXsSn1gZbhxQ+kCqhhbVnx4VgVYvGe GlhxWnr1pKQLxu4iil7fr146GTyHRviQPtRmuRzafuE0alNRjIQLtW/UnM/E2KSG+i vtMmttld9BZBSouwO9Pf/zx/JP4XK1JG2g/iMLNIJ4VF/Pzc2c1TNv2WxLNg8lLVrX NPp/uMJwCrkEg== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 2/3] kconfig: use linked list in get_symbol_str() to iterate over menus Date: Sun, 3 Mar 2024 13:00:34 +0900 Message-Id: <20240303040035.3450914-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240303040035.3450914-1-masahiroy@kernel.org> References: <20240303040035.3450914-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 Currently, get_symbol_str() uses a tricky approach to traverse the associated menus. With relevant menus now linked to the symbol using a linked list, use list_for_each_entry() for iterating on the menus. Signed-off-by: Masahiro Yamada --- scripts/kconfig/menu.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 571394ed71e0..840ce642ec43 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -771,6 +771,7 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym, struct list_head *head) { struct property *prop; + struct menu *menu; if (sym && sym->name) { str_printf(r, "Symbol: %s [=%s]\n", sym->name, @@ -787,17 +788,17 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym, } /* Print the definitions with prompts before the ones without */ - for_all_properties(sym, prop, P_SYMBOL) { - if (prop->menu->prompt) { - get_def_str(r, prop->menu); - get_prompt_str(r, prop->menu->prompt, head); + list_for_each_entry(menu, &sym->menus, link) { + if (menu->prompt) { + get_def_str(r, menu); + get_prompt_str(r, menu->prompt, head); } } - for_all_properties(sym, prop, P_SYMBOL) { - if (!prop->menu->prompt) { - get_def_str(r, prop->menu); - get_dep_str(r, prop->menu->dep, " Depends on: "); + list_for_each_entry(menu, &sym->menus, link) { + if (!menu->prompt) { + get_def_str(r, menu); + get_dep_str(r, menu->dep, " Depends on: "); } } -- 2.40.1