From: Heinrich Schuchardt Date: Tue, 4 Oct 2022 08:09:53 +0000 (+0200) Subject: cmd/sbi: error message for failure to get spec version X-Git-Tag: v2023.07~292^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=72c1f5f282737156ef630db911979eeb16796522;p=platform%2Fkernel%2Fu-boot.git cmd/sbi: error message for failure to get spec version If calling 'Get SBI specification version' fails, write an error message and return CMD_RET_FAILURE. Signed-off-by: Heinrich Schuchardt Reviewed-by: Rick Chen --- diff --git a/cmd/riscv/sbi.c b/cmd/riscv/sbi.c index 9bbe7d4..24955d2 100644 --- a/cmd/riscv/sbi.c +++ b/cmd/riscv/sbi.c @@ -56,8 +56,11 @@ static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc, long mvendorid, marchid, mimpid; ret = sbi_get_spec_version(); - if (ret >= 0) - printf("SBI %ld.%ld", ret >> 24, ret & 0xffffff); + if (ret < 0) { + printf("No SBI 0.2+\n"); + return CMD_RET_FAILURE; + } + printf("SBI %ld.%ld", ret >> 24, ret & 0xffffff); impl_id = sbi_get_impl_id(); if (impl_id >= 0) { for (i = 0; i < ARRAY_SIZE(implementations); ++i) {