All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]    hw/arm/aspeed: fix connect_serial_hds_to_uarts
@ 2024-12-12 13:31 ` kenneth_jia--- via
  0 siblings, 0 replies; 8+ messages in thread
From: kenneth_jia--- via @ 2024-12-12 13:31 UTC (permalink / raw)
  To: 'qemu-arm@nongnu.org'
  Cc: 'Cédric Le Goater',
	'Philippe Mathieu-Daudé', 'Jamin Lin',
	'Andrew Jeffery', 'Gavin Shan',
	'open list:All patches CC here'

[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]

From 24d3badbbb9dcc0d220609a7dd30f8da5002cba7 Mon Sep 17 00:00:00 2001
From: Kenneth Jia <kenneth_jia@asus.com>
Date: Thu, 12 Dec 2024 20:42:04 +0800
Subject: [PATCH]    hw/arm/aspeed: fix connect_serial_hds_to_uarts

   In the loop, we need ignore the index increase when uart == uart_chosen
   We should increase the index only after we allocate a serial.

Signed-off-by: Kenneth Jia <kenneth_jia@asus.com>
---
hw/arm/aspeed.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 556498f2a0..d8cb2d1429 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -364,11 +364,11 @@ static void connect_serial_hds_to_uarts(AspeedMachineState *bmc)
     int uart_chosen = bmc->uart_chosen ? bmc->uart_chosen : amc->uart_default;

     aspeed_soc_uart_set_chr(s, uart_chosen, serial_hd(0));
-    for (int i = 1, uart = sc->uarts_base; i < sc->uarts_num; i++, uart++) {
+    for (int i = 1, uart = sc->uarts_base; i < sc->uarts_num; uart++) {
         if (uart == uart_chosen) {
             continue;
         }
-        aspeed_soc_uart_set_chr(s, uart, serial_hd(i));
+        aspeed_soc_uart_set_chr(s, uart, serial_hd(i++));
     }
}

--
2.34.1

[-- Attachment #2: Type: text/html, Size: 5507 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-12-13 10:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12 13:31 [PATCH] hw/arm/aspeed: fix connect_serial_hds_to_uarts kenneth_jia--- via
2024-12-12 13:31 ` kenneth_jia--- via
2024-12-13  7:19 ` Cédric Le Goater
2024-12-13  9:48   ` 答复: " kenneth_jia--- via
2024-12-13  9:56     ` Cédric Le Goater
2024-12-13 10:11       ` 答复: " kenneth_jia--- via
2024-12-13 10:11         ` kenneth_jia--- via
2024-12-13 10:47 ` Cédric Le Goater

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.