Skip to content

Commit

Permalink
Fix legacy __rt_ffs_tiny()
Browse files Browse the repository at this point in the history
Some compiler complains value & (value - 1) ^ value
better (value & (value - 1)) ^ value
  • Loading branch information
pegasusplus authored Dec 1, 2024
1 parent a063f50 commit 0e9c6c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kservice.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] =
Expand Down

0 comments on commit 0e9c6c8

Please sign in to comment.