Skip to content

Commit 0e9c6c8

Browse files
authored
Fix legacy __rt_ffs_tiny()
Some compiler complains value & (value - 1) ^ value better (value & (value - 1)) ^ value
1 parent a063f50 commit 0e9c6c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/kservice.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ const rt_uint8_t __lowest_bit_bitmap[] =
10921092
*/
10931093
int __rt_ffs(int value)
10941094
{
1095-
return __lowest_bit_bitmap[(rt_uint32_t)(value & (value - 1) ^ value) % 37];
1095+
return __lowest_bit_bitmap[(rt_uint32_t)((value & (value - 1)) ^ value) % 37];
10961096
}
10971097
#else
10981098
const rt_uint8_t __lowest_bit_bitmap[] =

0 commit comments

Comments
 (0)