lib: sbi: Improve get_feature_str() implementation and usage
authorAnup Patel <anup.patel@wdc.com>
Sun, 10 May 2020 06:06:14 +0000 (11:36 +0530)
committerAnup Patel <anup@brainfault.org>
Tue, 19 May 2020 03:49:34 +0000 (09:19 +0530)
commit49841832b85bbcc8ae99dc2b808175a1a8650ff3
tree8f3460e224933741c99f6a84ca94baf039a165f0
parent28b40528499755ec19a6f8a06dc47e65619fb96c
lib: sbi: Improve get_feature_str() implementation and usage

We do following improvements for get_feature_str():
1. We should return "none" from get_feature_str() no features
   available instead of sbi_boot_prints() explicitly handling
   failure.
2. We don't need to return failure (just like misa_xlen())
   because we are returning "none" for no features and we are
   truncating output when space is not available.
3. Based on 1 and 2, the sbi_boot_prints() can be further
   simplified.
4. No need for two char[] in sbi_boot_prints()

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
include/sbi/sbi_hart.h
include/sbi/sbi_platform.h
lib/sbi/sbi_hart.c
lib/sbi/sbi_init.c
lib/sbi/sbi_platform.c