From 0e9c6c830f7c2bb162ac285bc144fd7efeda2441 Mon Sep 17 00:00:00 2001 From: Zhao Zhenping <1927818778@qq.com> Date: Sun, 1 Dec 2024 00:48:47 -0800 Subject: [PATCH] Fix legacy __rt_ffs_tiny() Some compiler complains value & (value - 1) ^ value better (value & (value - 1)) ^ value --- src/kservice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kservice.c b/src/kservice.c index 11f6202eef6..b1c275e079e 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -1092,7 +1092,7 @@ const rt_uint8_t __lowest_bit_bitmap[] = */ int __rt_ffs(int value) { - return __lowest_bit_bitmap[(rt_uint32_t)(value & (value - 1) ^ value) % 37]; + return __lowest_bit_bitmap[(rt_uint32_t)((value & (value - 1)) ^ value) % 37]; } #else const rt_uint8_t __lowest_bit_bitmap[] =