lib: sbi: fix ctz bug
authorXiang W <wxjstz@126.com>
Wed, 15 Sep 2021 06:50:52 +0000 (14:50 +0800)
committerAnup Patel <anup@brainfault.org>
Wed, 22 Sep 2021 07:56:23 +0000 (13:26 +0530)
commit3477f08b08da6bfd904218fdb76b3db592dd7ebd
tree2b2d0fe0b50f5ca8a4763fb88b434dcfd52d7c5e
parent395ff7eedec5e2b5b067e3725303a17352a07651
lib: sbi: fix ctz bug

The original version of ctz will cause an endless loop, if the parameter
passed in is 0. This commit fixes this bug.

Signed-off-by: Xiang W <wxjstz@126.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
lib/sbi/riscv_asm.c