From patchwork Sun Sep 29 17:32:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13815179 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 029AA38FB0; Sun, 29 Sep 2024 17:33:07 +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=1727631188; cv=none; b=dCSrCo2PxH133gqYRQwu/OQfG+RdmR+iP5w3EhSHVjk36n7wtm2pDhEBhmb7GD2+nOH9Seep1RSgb9t2pp93RNU1l/9sRWcmbegS1Cg6MIFvEXA8xAQvG7JGLoUsVshIKenBsCm3mgO718MciwU+MemE1DeZZ0FkNS1b5iPnXg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727631188; c=relaxed/simple; bh=2VgBZc4+23cLmlDCc2tO1++tWH4VilOu/a5VqAsUs0Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DC29hh0BTdGapBmwcQhMZ/XiOSxYm6SR6QC2MPjzE8QDfH3iCIOHCcE8haSuo4EHe3hUOC26vMNN7T2HVazIa3o+ya91r9mNasKr9yfpqjE50igq3WqOoVEGqiqdstjvw5fvVo5qIamlgQQ+jfUVzDVffbgtmDRRSdWI2fpgLKA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sxC0UJnP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sxC0UJnP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB9C9C4CEC5; Sun, 29 Sep 2024 17:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727631187; bh=2VgBZc4+23cLmlDCc2tO1++tWH4VilOu/a5VqAsUs0Y=; h=From:To:Cc:Subject:Date:From; b=sxC0UJnPxOtBdP81/U6TM1e96mZxPUEphglmPHRm7T88kEKGOA5LSNY8vuj4qZsyA bKzNCitrokn8Mx0Q/y1HrUJIm9b52EyBm8r7D4DdY/MLAVQbU7dTHxL7kKUzCNC3tY lENzlXJkSVlNRO6FB1mfXuP4y59NKkH3b/NAADFFjy2i7Xfzk+XGcdDu/1so2CdcMk EwOaVzZjdOjtbZM/Hu56zEs6jPi0ZWsZ9aEXTjvMkTxkNgWN5gZttbWtcwrg53J+3t Ev2mfN7OYM76K4PQ8yDJb5KE+LoHFlDnFDLl5elTcPwggGIieL27sKym5xvCF1ecsV qEp2/NvOW1M5Q== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 1/3] usb: use "prompt" instead of "bool" for choice prompts Date: Mon, 30 Sep 2024 02:32:36 +0900 Message-ID: <20240929173302.203827-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Since commit fde192511bdb ("kconfig: remove tristate choice support"), all choice blocks are now boolean. There is no longer a need to specify the choice type explicitly. Most choice blocks already use "prompt". Before the next commit removes support for the "bool" syntax in choice entries, this commit converts the remaining "bool" occurences under drivers/usb/. Signed-off-by: Masahiro Yamada --- drivers/usb/dwc2/Kconfig | 2 +- drivers/usb/dwc3/Kconfig | 2 +- drivers/usb/isp1760/Kconfig | 2 +- drivers/usb/mtu3/Kconfig | 2 +- drivers/usb/musb/Kconfig | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/dwc2/Kconfig b/drivers/usb/dwc2/Kconfig index c131719367ec..d7af55a8eced 100644 --- a/drivers/usb/dwc2/Kconfig +++ b/drivers/usb/dwc2/Kconfig @@ -21,7 +21,7 @@ config USB_DWC2 if USB_DWC2 choice - bool "DWC2 Mode Selection" + prompt "DWC2 Mode Selection" default USB_DWC2_DUAL_ROLE if (USB && USB_GADGET) default USB_DWC2_HOST if (USB && !USB_GADGET) default USB_DWC2_PERIPHERAL if (!USB && USB_GADGET) diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index 31078f3d41b8..310d182e10b5 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig @@ -23,7 +23,7 @@ config USB_DWC3_ULPI controller. choice - bool "DWC3 Mode Selection" + prompt "DWC3 Mode Selection" default USB_DWC3_DUAL_ROLE if (USB && USB_GADGET) default USB_DWC3_HOST if (USB && !USB_GADGET) default USB_DWC3_GADGET if (!USB && USB_GADGET) diff --git a/drivers/usb/isp1760/Kconfig b/drivers/usb/isp1760/Kconfig index 2ed2b73291d1..e19178f3cdd3 100644 --- a/drivers/usb/isp1760/Kconfig +++ b/drivers/usb/isp1760/Kconfig @@ -26,7 +26,7 @@ config USB_ISP1761_UDC if USB_ISP1760 choice - bool "ISP1760 Mode Selection" + prompt "ISP1760 Mode Selection" default USB_ISP1760_DUAL_ROLE if (USB && USB_GADGET) default USB_ISP1760_HOST_ROLE if (USB && !USB_GADGET) default USB_ISP1760_GADGET_ROLE if (!USB && USB_GADGET) diff --git a/drivers/usb/mtu3/Kconfig b/drivers/usb/mtu3/Kconfig index bf98fd36341d..d281da1cdbcc 100644 --- a/drivers/usb/mtu3/Kconfig +++ b/drivers/usb/mtu3/Kconfig @@ -21,7 +21,7 @@ config USB_MTU3 if USB_MTU3 choice - bool "MTU3 Mode Selection" + prompt "MTU3 Mode Selection" default USB_MTU3_DUAL_ROLE if (USB && USB_GADGET) default USB_MTU3_HOST if (USB && !USB_GADGET) default USB_MTU3_GADGET if (!USB && USB_GADGET) diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index 9a8cf3de0617..9e45d12b81d3 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig @@ -29,7 +29,7 @@ config USB_MUSB_HDRC if USB_MUSB_HDRC choice - bool "MUSB Mode Selection" + prompt "MUSB Mode Selection" default USB_MUSB_DUAL_ROLE if (USB && USB_GADGET) default USB_MUSB_HOST if (USB && !USB_GADGET) default USB_MUSB_GADGET if (!USB && USB_GADGET) From patchwork Sun Sep 29 17:32:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13815180 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 7B17B3BB21; Sun, 29 Sep 2024 17:33:09 +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=1727631189; cv=none; b=IGH2TQA0OUUzvnsCp0yo+ZpkbpF3JLo+KTR0+l4SxlFnvt2fgVejD0YMmOph5kVaK22DlJ3O4BX5rTgQlpgbWqjP1aBq0nBa1J1iYwaIRXAUO5nUhYGqtAKP39/R0EVF00Ddxt47TeA1q/5gOiI0ay9nRBEU/39OusyFOcDDZlY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727631189; c=relaxed/simple; bh=O5v5k+Gc3q1ZoQUuGzDLkB9PDIzH1nVUyxFhHXjdD9g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MnhQDi5oh8YDraeAy8izC31idGScOpZvckHugwz7Vgn4FO7S4bJdjE5ThD5HeQTseusHUpEkpSqZE6BdMw8gXHZB1EaXADRR9vuKEyL4I1WAaeAelW98fiCELdKVPtQXSKbieQsHN5/LfN8BlY+gpam3GmzpmYvnb63Ed+UnwMQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TVEyyu7k; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TVEyyu7k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AE1DC4CEC5; Sun, 29 Sep 2024 17:33:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727631189; bh=O5v5k+Gc3q1ZoQUuGzDLkB9PDIzH1nVUyxFhHXjdD9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TVEyyu7kiyZ/VBq7Kp91r4UQjeBAjE14q0YnXgaEvkZzM071F5EC5almNgBzzCBZt 8C0kYqypkdXKgOG/MTYlQihINwSo2guIWeNarDmgCoPJNQTgrU2WN2b69rz6v5GyDk RUvt4FdmnVtddQ0KRb+NZYhI6jiVLP0y2zDVd5Vie+cIXjGeSx+Btn5RcSLtTXOA7e UR6yCWKl1J4PTbvGJAw6lCFCPk4QRbZZQdvd5ZGZMMmC+E2kmA5KSWw0xsa463gSJG 2nmri+/2mzLkHEcoDXjyD4kdKjPbCmCP3dsaW3+PWw46RHxLaz0ZvVYdWl6X02q1kc DS7H3V6wMfZHQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 2/3] kconfig: remove support for "bool" prompt for choice entries Date: Mon, 30 Sep 2024 02:32:37 +0900 Message-ID: <20240929173302.203827-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240929173302.203827-1-masahiroy@kernel.org> References: <20240929173302.203827-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Since commit fde192511bdb ("kconfig: remove tristate choice support"), all choice blocks are now boolean. There is no longer a need to specify the choice type explicitly. All "bool" prompts in choice entries have been converted to "prompt". This commit removes support for the "bool" syntax in choice entries. Signed-off-by: Masahiro Yamada --- Documentation/kbuild/kconfig-language.rst | 4 ++-- scripts/kconfig/parser.y | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbuild/kconfig-language.rst index 43037be96a16..2619fdf56e68 100644 --- a/Documentation/kbuild/kconfig-language.rst +++ b/Documentation/kbuild/kconfig-language.rst @@ -412,8 +412,8 @@ choices:: "endchoice" -This defines a choice group and accepts any of the above attributes as -options. +This defines a choice group and accepts "prompt", "default", "depends on", and +"help" attributes as options. A choice only allows a single config entry to be selected. diff --git a/scripts/kconfig/parser.y b/scripts/kconfig/parser.y index 1ad60f9e164e..4b9eaee20eaf 100644 --- a/scripts/kconfig/parser.y +++ b/scripts/kconfig/parser.y @@ -287,12 +287,6 @@ choice_option: T_PROMPT T_WORD_QUOTE if_expr T_EOL printd(DEBUG_PARSE, "%s:%d:prompt\n", cur_filename, cur_lineno); }; -choice_option: T_BOOL T_WORD_QUOTE if_expr T_EOL -{ - menu_add_prompt(P_PROMPT, $2, $3); - printd(DEBUG_PARSE, "%s:%d:bool\n", cur_filename, cur_lineno); -}; - choice_option: T_DEFAULT nonconst_symbol if_expr T_EOL { menu_add_symbol(P_DEFAULT, $2, $3); From patchwork Sun Sep 29 17:32:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13815181 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 E559042ABE; Sun, 29 Sep 2024 17:33:10 +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=1727631191; cv=none; b=WzJ3WnhClMF9g+bwUM6u1otbEZOwmVDg3CklxlzMLgzZQmiVEXHsy+VuNR2FbOKcyV8/6vE029+KWC1OEBSBgXr1Bo0syKE9+AGeLW/TSikDt5uraZn1JjnUiTa3gsQ+uKqv+anPmVkcTMoJwCb5OWPfp6fd5edghqw0IcNWnNc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727631191; c=relaxed/simple; bh=dpgEsZGae4ivMo/aeUVDr+TCQSBfCccOgJX3t1cmjD0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nU8SLVFSpY5/w3521vN8bRyO4NjRFDIzyx0g5rwkizmxpFkgcDrJj73Wl8EzB5Ix1qlVd3gRP75mUW50RBSKlPtzgNNYO6bhnDXxSS9//ltx5aTNLzUmmsTFv8X8Up3FtuhMibRnd0tsKopFht5FXnmEGrJpkhWBXIRRAc1RKdw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h1LZYHep; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="h1LZYHep" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96A7BC4CECD; Sun, 29 Sep 2024 17:33:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727631190; bh=dpgEsZGae4ivMo/aeUVDr+TCQSBfCccOgJX3t1cmjD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h1LZYHepd4OPUjfNGBOqwnF4Ccmb37weZ4QfQ1Odc35tYfPUtLxvZ99jmGRCwrHax yb8JVY/yMH4P7y8KkGrNdczF/LUPe70MSz25r0zEyB/JlNAkkztT7LK0NnNYHQIEUM neVEK3yZPI2GWJ4nNrRVbeHY2wp5+gGYh/5xKsgJ8qi05PNvQ6p2LgWM5UFj4hmqU6 F+4imWjEVLROGCdx3q96ObKZNhhGNC3+fWrUKRNo4okTNUZfVF1rg26aJ5yn1Kas6c 6OuBmpt76qQCB6kxON5H7B36yzJx1QE65LnEyOTmg+22EMOoRsPZtgvmDSSnkIs/cs gK1v+BxOjV57A== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 3/3] kconfig: remove zconfprint() Date: Mon, 30 Sep 2024 02:32:38 +0900 Message-ID: <20240929173302.203827-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240929173302.203827-1-masahiroy@kernel.org> References: <20240929173302.203827-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Turn all warnings during parsing into hard errors. Signed-off-by: Masahiro Yamada --- scripts/kconfig/parser.y | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/scripts/kconfig/parser.y b/scripts/kconfig/parser.y index 4b9eaee20eaf..aef1fad13671 100644 --- a/scripts/kconfig/parser.y +++ b/scripts/kconfig/parser.y @@ -24,7 +24,6 @@ int cdebug = PRINTD; static void yyerror(const char *err); -static void zconfprint(const char *err, ...); static void zconf_error(const char *err, ...); static bool zconf_endtoken(const char *tokenname, const char *expected_tokenname); @@ -177,7 +176,7 @@ menuconfig_stmt: menuconfig_entry_start config_option_list if (current_entry->prompt) current_entry->prompt->type = P_MENU; else - zconfprint("warning: menuconfig statement without prompt"); + zconf_error("menuconfig statement without prompt"); printd(DEBUG_PARSE, "%s:%d:endconfig\n", cur_filename, cur_lineno); }; @@ -396,14 +395,14 @@ help: help_start T_HELPTEXT { if (current_entry->help) { free(current_entry->help); - zconfprint("warning: '%s' defined with more than one help text -- only the last one will be used", - current_entry->sym->name ?: ""); + zconf_error("'%s' defined with more than one help text", + current_entry->sym->name ?: ""); } /* Is the help text empty or all whitespace? */ if ($2[strspn($2, " \f\n\r\t\v")] == '\0') - zconfprint("warning: '%s' defined with blank help text", - current_entry->sym->name ?: ""); + zconf_error("'%s' defined with blank help text", + current_entry->sym->name ?: ""); current_entry->help = $2; }; @@ -586,17 +585,6 @@ static bool zconf_endtoken(const char *tokenname, return true; } -static void zconfprint(const char *err, ...) -{ - va_list ap; - - fprintf(stderr, "%s:%d: ", cur_filename, cur_lineno); - va_start(ap, err); - vfprintf(stderr, err, ap); - va_end(ap); - fprintf(stderr, "\n"); -} - static void zconf_error(const char *err, ...) { va_list ap;