[PATCH] hvc_vio: fix CONFIG_HVC_OLD_HVSI ifdef guards

From: Pengpeng Hou

Date: Thu Dec 03 2026 - 21:14:25 EST


When the old HVSI driver is selected, HVC VIO should exclude the
overlapping protocol match and stop after its early console setup. Both
tests currently use HVC_OLD_HVSI without its CONFIG_ prefix.

Use the configured symbol at both sites, without changing the other
terminal protocols.

The issue was found by our static-analysis tool and manually reviewed.

Fixes: 4d2bb3f50036 ("powerpc/pseries: Re-implement HVSI as part of hvc_vio")
Signed-off-by: Pengpeng Hou <hppiscas@xxxxxxx>
---
The original patch was prepared with Gemini. Codex assisted with this
review and revision (Assisted-by: gpt 5).
Built hvc_vio.o for pSeries with Clang 18 and W=1 with HVC_OLD_HVSI=y.
The hvc_driver_table initializer no longer included hvterm-protocol
after the change, while hvterm1 remained. No console I/O was performed.

drivers/tty/hvc/hvc_vio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c
index 14c6a556461769efca84df643897e4e6bec6f626..7b7373eaaa407ad35239c438172b75f3f6de2883 100644
--- a/drivers/tty/hvc/hvc_vio.c
+++ b/drivers/tty/hvc/hvc_vio.c
@@ -42,7 +42,7 @@ static const char hvc_driver_name[] = "hvc_console";

static const struct vio_device_id hvc_driver_table[] = {
{"serial", "hvterm1"},
-#ifndef HVC_OLD_HVSI
+#ifndef CONFIG_HVC_OLD_HVSI
{"serial", "hvterm-protocol"},
#endif
{ "", "" }
@@ -417,7 +417,7 @@ void __init hvc_vio_init_early(void)
udbg_putc = udbg_hvc_putc;
udbg_getc = udbg_hvc_getc;
udbg_getc_poll = udbg_hvc_getc_poll;
-#ifdef HVC_OLD_HVSI
+#ifdef CONFIG_HVC_OLD_HVSI
/* When using the old HVSI driver don't register the HVC
* backend for HVSI, only do udbg
*/

base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106