From patchwork Fri Feb 2 15:57:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 19853 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp521580dyc; Fri, 2 Feb 2024 07:59:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaWtDLx+ullk7yAqGu/LSy5K2ohKQv8loaUpHZSGpWDfhdLZaztZpMbhnaEcbmDK465Zeg X-Received: by 2002:a17:906:27d6:b0:a31:117b:8b54 with SMTP id k22-20020a17090627d600b00a31117b8b54mr6015720ejc.15.1706889549696; Fri, 02 Feb 2024 07:59:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706889549; cv=pass; d=google.com; s=arc-20160816; b=IHF++zzT2J9vSS0mrc5J9YHKV44cp1i0M9e/H6n9ZXot140kPdUwaz/v/PCyvNbL/u Z7P3DiD/BwOrJIPbSN+hnNtP2RRLpjaITlS5IaX7lvSSDuMX2uZAdI6dYr32/gd1dRvw RIT1sLcTWxGS4Vvm3HkoUKZYGUc3zk2BbqKDMlyW2/SX/YWBxNtLp//24fsHTZaPTdwR 4Ac38W829Dq6y6fPXWeHJouRLarc7Qoof1GkbvUtw9mSPGRI1wIu1wnAlmkju5S1mtQZ iVi7qgNR3PU1b5nVwp0fCzMbOdcnTIqaEGca7/t8KTfDKvt0fdYNCqhkbvVPeH8FAr62 +u8w== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=wNVlMfNqViKOnEhjZgCPJjVbUuGUuZv4rmGZUHkrEHc=; fh=+b6bqfsoNBQ9Dn2dIoRguxojaLwPwuAlnV+Xg12ipHw=; b=Pnt6zmIEOI7c5755zB3KUAK+03mzQpY1mSzYe8K3DL+9EUWFvJK/qYJSBWI3NiK3IO Z9AfibUPsU3ur2bdOtQ/lq1ZTD9Rb4TOdj8yneB97tdgh/FzRimiJTSn6xuZLN1V5cJv bSUezPZRXJ/p2hBlt2VS+61akIRbeB6bYUToES/LCU077z0uNL1p3f5VtcUrRtMR3U7n fMNO+qQwTu5WESRSCX2ga9TOLW7sqr0ETaSbbc4u0qblej8yjOEKwuv7KaUxwNMbt+D3 Azmo/QFfR3B0OdIsfjtxLPSEQkutdZGxcHyo7HR+iQ2q/ERmK9Djb4P4yr5SoA1C9z+D 9hXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gPvFaSbk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50059-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50059-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCVpl5+B56+TGMyUvheccjyDLvBLLMMlcq7dLhEJpoSza+LZH/5DD0gfzRlHqFtZRNdtX4CEXyC5ZKbLKE3lHqo7GAVUvg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s3-20020a170906060300b00a36fd6856b8si803165ejb.791.2024.02.02.07.59.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 07:59:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50059-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=gPvFaSbk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50059-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50059-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 50F8E1F29497 for ; Fri, 2 Feb 2024 15:59:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B99701482F8; Fri, 2 Feb 2024 15:58:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gPvFaSbk" 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 06A091474C1; Fri, 2 Feb 2024 15:58:30 +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=1706889511; cv=none; b=RzUNpUPOWp9nKEcUEuE3MWayQT1+cno82Y72HdKjY89SSasR5ixf5nN9RFVPz29U+H9DColAZN285Z6O4qBq6BMAXorPf8Agcxct1NARxzqf5SHxfkH561dVrIgTg7jDtKPlQy/fO1Ndq0CBeP2X93+zrh7td1odiJ0JoI3wpcI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706889511; c=relaxed/simple; bh=THdTZv21XZx2i61Uk13KVjH1FY7txkw6aueP1w2kwcI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=sCnO2hrKdMGhJvLaWO3pX0w6d9AzlCp7iV3WcLamU+u3E1HDZW+HdIbQWUaiPVyN3Tnyi5jB9ABqbWyahuEkpcg9ULFcAf1SEoHYGgKmu84ODa0NnJHXpQ8ay5u6twE0IM8XQCYlwr2UrqJjJc+pHsxsmFk1Xi6o+NVPpqGR7CQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gPvFaSbk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1FA8C433C7; Fri, 2 Feb 2024 15:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706889510; bh=THdTZv21XZx2i61Uk13KVjH1FY7txkw6aueP1w2kwcI=; h=From:To:Cc:Subject:Date:From; b=gPvFaSbkOu1EVcR0LO3IDxDJRosfPHPMRL1ZpU5T1Whg3aHQRzcWeBA7MPq/VOnOR XzoeMdtOkqJSO1A9rueHd3DGa1hSRxUjBlaPCOrJ2MHqquQAe8ksgpIVTunv6EmuXc SfeqkZdTGBeGZ37BMahqX1FdLzwEDHKhImJrLFIoHr72WBZPDIkOsLa2ebwckAZL3F w2JAjeY/pFewx0PEqqO970UAUfdoeymZUvOssQ3PKUDssE1oAaPlsdn+DzdpcfbW1P JXvvLn5PhhHcVDoNVYnzKS5xMAaOUFL1+pUVl7xDGB7AqgS0Z1t8v9Z+jst2R9yOqY 0/PEgtbKDhJhg== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 00/27] kconfig: refactor lexer and parser code Date: Sat, 3 Feb 2024 00:57:58 +0900 Message-Id: <20240202155825.314567-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 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: 1789803416146748064 X-GMAIL-MSGID: 1789803416146748064 Random fixes, cleanups, etc. Masahiro Yamada (27): kconfig: fix infinite loop when expanding a macro at the end of file kconfig: fix off-by-one in zconf_error() kconfig: remove orphan lookup_file() declaration kconfig: remove compat_getline() kconfig: remove unneeded sym_find() call in conf_parse() kconfig: write Kconfig files to autoconf.cmd in order kconfig: call env_write_dep() right after yyparse() kconfig: split preprocessor prototypes into preprocess.h kconfig: replace current_pos with separate cur_{filename,lineno} kconfig: remove zconf_curname() and zconf_lineno() kconfig: associate struct menu with file name directly kconfig: associate struct property with file name directly kconfig: replace file->name with name in zconf_nextfile() kconfig: do not delay the cur_filename update kconfig: replace remaining current_file->name with cur_filename kconfig: move the file and lineno in struct file to struct buffer kconfig: make file::name a flexible array member kconfig: change file_lookup() to return the file name kconfig: split list_head into a separate header kconfig: resync list.h kconfig: import more list macros and inline functions kconfig: add macros useful for hashtable kconfig: move ARRAY_SIZE to a header kconfig: move strhash() to a header kconfig: convert linked list of files to hash table kconfig: use generic macros to implement symbol hashtable kconfig: do not imply the type of choice value scripts/kconfig/array_size.h | 11 ++ scripts/kconfig/conf.c | 12 +- scripts/kconfig/confdata.c | 91 +++---------- scripts/kconfig/expr.h | 24 +--- scripts/kconfig/hashtable.h | 48 +++++++ scripts/kconfig/internal.h | 12 ++ scripts/kconfig/lexer.l | 100 +++++++------- scripts/kconfig/list.h | 254 ++++++++++++++++++++++++++--------- scripts/kconfig/list_types.h | 17 +++ scripts/kconfig/lkc.h | 5 +- scripts/kconfig/lkc_proto.h | 15 --- scripts/kconfig/mconf.c | 1 + scripts/kconfig/menu.c | 24 ++-- scripts/kconfig/nconf.c | 1 + scripts/kconfig/parser.y | 92 +++++++------ scripts/kconfig/preprocess.c | 23 ++-- scripts/kconfig/preprocess.h | 19 +++ scripts/kconfig/qconf.cc | 2 +- scripts/kconfig/symbol.c | 46 +++---- scripts/kconfig/util.c | 38 ++++-- scripts/kconfig/util.h | 15 +++ 21 files changed, 511 insertions(+), 339 deletions(-) create mode 100644 scripts/kconfig/array_size.h create mode 100644 scripts/kconfig/hashtable.h create mode 100644 scripts/kconfig/list_types.h create mode 100644 scripts/kconfig/preprocess.h create mode 100644 scripts/kconfig/util.h