From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Date: Wed, 6 Mar 2024 14:44:02 +0000 (+0100)
Subject: cmd: sbi: Correctly display unknown implementation IDs
X-Git-Tag: v2025.01-rc5-pxa1908~622^2~3
X-Git-Url: http://git.dujemihanovic.xyz/html/static/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=4de6d37fa289a4da32a395e5cc97a6649b948144;p=u-boot.git

cmd: sbi: Correctly display unknown implementation IDs

For an unknown implementation ID an output like

    SBI 1.0Unknown implementation ID 16777216
    Extensions:
      sbi_set_timer
      ...

was shown. The number 16777216 is not the implementation ID.

* Show the correct number
* Use a hexadecimal output format
* Add a missing line feed

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
---

diff --git a/cmd/riscv/sbi.c b/cmd/riscv/sbi.c
index 9daf0e247a..87f7966f06 100644
--- a/cmd/riscv/sbi.c
+++ b/cmd/riscv/sbi.c
@@ -99,7 +99,7 @@ static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc,
 			}
 		}
 		if (i == ARRAY_SIZE(implementations))
-			printf("Unknown implementation ID %ld", ret);
+			printf("\nUnknown implementation ID 0x%x", impl_id);
 	}
 	printf("\nMachine:\n");
 	ret = sbi_get_mvendorid(&mvendorid);