Skip to content

Commit 012e301

Browse files
wdfk-progRbb666
authored andcommitted
docs(kservice): Update the documentation comments of the fls function
1 parent 05445c0 commit 012e301

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/kservice.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,13 +1104,19 @@ RTM_EXPORT(rt_free_align);
11041104
#endif /* RT_USING_HEAP */
11051105

11061106
/**
1107-
* fls - find last (most-significant) bit set
1108-
* @x: the word to search
1107+
* @brief Find the index of the most significant set bit in a 32-bit integer.
1108+
* @details The result is the position of the highest bit set to 1, counting
1109+
* from 1 for the least significant bit. If the input value is 0, the function
1110+
* returns 0.
11091111
*
1110-
* This is defined the same way as ffs.
1111-
* Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
1112+
* Examples:
1113+
* - fls(0) = 0
1114+
* - fls(1) = 1
1115+
* - fls(0x80000000) = 32
1116+
*
1117+
* @param val 32-bit integer value to examine.
1118+
* @return Position of the most significant set bit (1–32), or 0 if @p val is 0.
11121119
*/
1113-
11141120
int __rt_fls(int val)
11151121
{
11161122
int bit = 32;

0 commit comments

Comments
 (0)