lib: sbi: simplify pmp_set(), pmp_get()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 17 Dec 2021 17:02:58 +0000 (18:02 +0100)
committerAnup Patel <anup@brainfault.org>
Wed, 22 Dec 2021 03:35:05 +0000 (09:05 +0530)
commit2082153fc90c54b98647b1fbaeb7511fd57b7d2b
tree27afbf0ba9f31a9be6125909ca3e46f210ff80b3
parentf27035981096e8d272d94dc17402b10567429869
lib: sbi: simplify pmp_set(), pmp_get()

pmpcfg_csr and pmpcfg_shift are only negative for an unexpected value of
__riscv_xlen. We can immediately return in this case.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Dong Du <Dd_nirvana@sjtu.edu.cn>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
lib/sbi/riscv_asm.c