From 50f06cad55df9f5f26e9066447a34bd75543f8f7 Mon Sep 17 00:00:00 2001 From: Xiangyang Wu Date: Tue, 3 Jul 2018 09:25:50 +0800 Subject: [PATCH] HV:treewide: Rename bit operation function fls as fls32 Rename bit operation function fls as fls32, keep name style with other bit operation function. Signed-off-by: Xiangyang Wu Acked-by: Eddie Dong --- hypervisor/arch/x86/guest/vlapic.c | 4 ++-- hypervisor/include/lib/bits.h | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hypervisor/arch/x86/guest/vlapic.c b/hypervisor/arch/x86/guest/vlapic.c index 326c10d52..46768a36d 100644 --- a/hypervisor/arch/x86/guest/vlapic.c +++ b/hypervisor/arch/x86/guest/vlapic.c @@ -774,7 +774,7 @@ vlapic_process_eoi(struct vlapic *vlapic) tmrptr = &lapic->tmr[0]; for (i = 7; i >= 0; i--) { - bitpos = fls(isrptr[i].val); + bitpos = fls32(isrptr[i].val); if (bitpos != INVALID_BIT_INDEX) { if (vlapic->isrvec_stk_top <= 0) { panic("invalid vlapic isrvec_stk_top %d", @@ -1145,7 +1145,7 @@ vlapic_pending_intr(struct vlapic *vlapic, uint32_t *vecptr) for (i = 7; i >= 0; i--) { val = atomic_load((int *)&irrptr[i].val); - bitpos = fls(val); + bitpos = fls32(val); if (bitpos != INVALID_BIT_INDEX) { vector = (uint32_t)(i * 32) + (uint32_t)bitpos; if (PRIO(vector) > PRIO(lapic->ppr)) { diff --git a/hypervisor/include/lib/bits.h b/hypervisor/include/lib/bits.h index 17c8ac708..d4a5c7035 100644 --- a/hypervisor/include/lib/bits.h +++ b/hypervisor/include/lib/bits.h @@ -42,7 +42,7 @@ /** * - * fls - Find the Last (most significant) bit Set in value and + * fls32 - Find the Last (most significant) bit Set in value and * return the bit index of that bit. * * Bits are numbered starting at 0,the least significant bit. @@ -50,11 +50,11 @@ * invalid bit index when the input argument was zero. * * Examples: - * fls (0x0) = INVALID_BIT_INDEX - * fls (0x01) = 0 - * fls (0x80) = 7 + * fls32 (0x0) = INVALID_BIT_INDEX + * fls32 (0x01) = 0 + * fls32 (0x80) = 7 * ... - * fls (0x80000001) = 31 + * fls32 (0x80000001) = 31 * * @param value: 'uint32_t' type value * @@ -63,7 +63,7 @@ * set and return the invalid bit index directly. * * **/ -static inline uint16_t fls(uint32_t value) +static inline uint16_t fls32(uint32_t value) { uint32_t ret = 0U; if (value == 0U) @@ -147,7 +147,7 @@ static inline uint16_t clz(uint32_t value) if (value == 0U) return 32U; else{ - return (31U - fls(value)); + return (31U - fls32(value)); } }