提交 8f51558e 编写于 作者: Y Yury Norov

risc-v: replace bitmap_weight with bitmap_empty in riscv_fill_hwcap()

bitmap_empty() is better than bitmap_weight() because it may return
earlier, and improves on readability.

CC: Albert Ou <aou@eecs.berkeley.edu>
CC: Anup Patel <anup@brainfault.org>
CC: Atish Patra <atishp@atishpatra.org>
CC: Jisheng Zhang <jszhang@kernel.org>
CC: Palmer Dabbelt <palmer@dabbelt.com>
CC: Paul Walmsley <paul.walmsley@sifive.com>
CC: Tsukasa OI <research_trasio@irq.a4lg.com>
CC: linux-riscv@lists.infradead.org
CC: linux-kernel@vger.kernel.org
Signed-off-by: NYury Norov <yury.norov@gmail.com>
Reviewed-by: NAnup Patel <anup@brainfault.org>
上级 5f8dac3f
...@@ -206,11 +206,10 @@ void __init riscv_fill_hwcap(void) ...@@ -206,11 +206,10 @@ void __init riscv_fill_hwcap(void)
else else
elf_hwcap = this_hwcap; elf_hwcap = this_hwcap;
if (bitmap_weight(riscv_isa, RISCV_ISA_EXT_MAX)) if (bitmap_empty(riscv_isa, RISCV_ISA_EXT_MAX))
bitmap_and(riscv_isa, riscv_isa, this_isa, RISCV_ISA_EXT_MAX);
else
bitmap_copy(riscv_isa, this_isa, RISCV_ISA_EXT_MAX); bitmap_copy(riscv_isa, this_isa, RISCV_ISA_EXT_MAX);
else
bitmap_and(riscv_isa, riscv_isa, this_isa, RISCV_ISA_EXT_MAX);
} }
/* We don't support systems with F but without D, so mask those out /* We don't support systems with F but without D, so mask those out
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册