Message ID | 20240202155825.314567-24-masahiroy@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-50083-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp527128dyc; Fri, 2 Feb 2024 08:05:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDECs0xYV6PZ3QbbdBoRqP9xM5SI/cNNJHFU5pcTMvpdzLtE6R4uHi3fnyTWpjBBRtzptl X-Received: by 2002:aa7:c30f:0:b0:55f:fdd3:ffe9 with SMTP id l15-20020aa7c30f000000b0055ffdd3ffe9mr68949edq.34.1706889932006; Fri, 02 Feb 2024 08:05:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706889931; cv=pass; d=google.com; s=arc-20160816; b=SH4js8SgVS/lbP3CB8c1FXuquMB+l35CQRO2wq5J8Z6OGHPCnvVWcPhjlag+xiPZXZ AZJwnGWRh4CD4xAJEiTiuhTBysdMHCP8JpkBHrQBeIAPrRbFAocOsjuJ/P4ZczIJhQ/Q rygBwaYjPTKuAGdzCuS6U3ZO0g8bOeeqizctXIICJeKLGo1Y5Nh/wq+tHVkkXuFxpLoQ lTBh/BdUB977C6aH2vndxrJbBdX/OJi2sG+KEmP+qLFbfMwwEl6UXMVxaeRJTt6fdk9w 6J9Vrk8CY0jNLA1eQJcHk9Vktofsp0zY5vMtvxki3DuZsjojuwFRAtydY3WekyGM5oz2 DV8Q== 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=JN5yS+cv7xBWiUFCFeGwyWAspmZKD60ePXz+NQ6GwZI=; fh=08zWp6a3Fj0opPwQzaD0pcIvcNRmow508FfZyardDU8=; b=BmJw5oLoqAtb6MnXmTWj7GL85RAIIHXwUZQCmimWVBzP8xa9TBxd/wt5inEz2UniIP ccXGgvBujQCJHMXpiIU0tEnz3XhfxYb+vt5tjIMZi11lGmqkptB8aP8i7iwrzhSmLeP+ BhHgqkM/CLcm5VrWGQwEYIfGyoajz6iGlHeLaOHOBpi1z3WMweNPvmWBXfVnhTtuhs4D dv1QO8v8gCugjtJ2Uo5a9MzRA3nqsIdh8YJGvZ7gk0LGtbJ5yrekDbOIHk6B3VoXIfRr BXTMjViWSM4rZ0i3m+ISKd5QldxpEUZbZn8HSWyjAfuumvdodJl1TwnTU40IFjcHNru0 zhjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kkc9Q6OS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50083-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50083-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXGwYfBFpBIXLvDRopYcyo5pRVbGfYnKbrYV861qW715YUZzgi+QYSrtf9pg4wqI0r/8X5SUdQdJksKSF91jSg0JA+s5w== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b5-20020a50ccc5000000b0055fa3cf748csi889826edj.175.2024.02.02.08.05.31 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 08:05:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50083-ouuuleilei=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=Kkc9Q6OS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50083-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50083-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9DC611F27101 for <ouuuleilei@gmail.com>; Fri, 2 Feb 2024 16:05:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A46D15145C; Fri, 2 Feb 2024 15:58:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Kkc9Q6OS" 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 2F8BE15146A; Fri, 2 Feb 2024 15:58:56 +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=1706889536; cv=none; b=KHPs+jMNNYWh/ls5ITFYvKqyZh8oZjnW/Nenk6hVzBOcSoIx11bwX7xigyrm9TCaWKmOtuGAaS8UJBTSljhwmCrqPOB25wAHmRXDtIrRsoz7+9WdJqtEgx4iCigBXwJ2aGSC+g9O+KS8z4QRFzaJfetGbeRmmQNzBpI06xBRoPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706889536; c=relaxed/simple; bh=LeeYFsCIF6jDZaXspMRRLlPcTtCrfxsxcxXxfVfjmc0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HIw0vTeqA0D/XXCm+xaCB/sq8kZZj4xMz0RCd0D8akkbcKjHjREX4DbIdYWCgP2BBS0Y3YkRAZQeROVB5rVA2bFfrDok3xz52jRsAN8NAzlImJolXD5vZHrmXQ5E4g4RWBnjKFwbkCGcPxSOgxdqNauJEqnfCaz62vggGxpTeyI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Kkc9Q6OS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61B4DC433F1; Fri, 2 Feb 2024 15:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706889536; bh=LeeYFsCIF6jDZaXspMRRLlPcTtCrfxsxcxXxfVfjmc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kkc9Q6OSx+NQaYN1sXTTciCIjpY02DiMrnw3OleDHjk5VD+kSkBImHGMcgWf/1iDh sMgA/LQnwK3mdSpWUsvTs5dmDQwX7R0MBhkIVfBqvnX9Qwl59R+jg4bXCKPvgeZVak /S1sGv4hGcko/u24kLpl2bCnT5FLovzT5GUL0PWgbNme/msrogeqVc2S/NMxbCrvfw 1dTeNrlvZohRQ2iXm1aMuecrCBYziAbXPHt7e3bq/bDPD/WqW3XTAVfzK56Jkh/LO4 nolyr+Zxu2erGeuKFNyWtmzsTxP1ipokaw1q11yag58BiT0FBo+lby705ywg/QqqS9 p+LB6iGLYFwew== From: Masahiro Yamada <masahiroy@kernel.org> To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada <masahiroy@kernel.org> Subject: [PATCH 23/27] kconfig: move ARRAY_SIZE to a header Date: Sat, 3 Feb 2024 00:58:21 +0900 Message-Id: <20240202155825.314567-24-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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789803817627291018 X-GMAIL-MSGID: 1789803817627291018 |
Series |
kconfig: refactor lexer and parser code
|
|
Commit Message
Masahiro Yamada
Feb. 2, 2024, 3:58 p.m. UTC
To use ARRAY_SIZE from other files, move it to its own header,
just like include/linux/array_size.h.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/kconfig/array_size.h | 11 +++++++++++
scripts/kconfig/preprocess.c | 3 +--
2 files changed, 12 insertions(+), 2 deletions(-)
create mode 100644 scripts/kconfig/array_size.h
diff --git a/scripts/kconfig/array_size.h b/scripts/kconfig/array_size.h new file mode 100644 index 000000000000..26ba78d867d1 --- /dev/null +++ b/scripts/kconfig/array_size.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef ARRAY_SIZE_H +#define ARRAY_SIZE_H + +/** + * ARRAY_SIZE - get the number of elements in array @arr + * @arr: array to be sized + */ +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) + +#endif /* ARRAY_SIZE_H */ diff --git a/scripts/kconfig/preprocess.c b/scripts/kconfig/preprocess.c index 69b806a6d8b7..f0a4a218c4a5 100644 --- a/scripts/kconfig/preprocess.c +++ b/scripts/kconfig/preprocess.c @@ -9,13 +9,12 @@ #include <stdlib.h> #include <string.h> +#include "array_size.h" #include "internal.h" #include "list.h" #include "lkc.h" #include "preprocess.h" -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) - static char *expand_string_with_args(const char *in, int argc, char *argv[]); static char *expand_string(const char *in);