Skip to content

Commit 45c28cd

Browse files
YuryNorovrostedt
authored andcommitted
tracing: Cleanup upper_empty() in pid_list
Instead of find_first_bit() use the dedicated bitmap_empty(), and make upper_empty() a nice one-liner. While there, fix opencoded BITS_PER_TYPE(). Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Yury Norov <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 7b382ef commit 45c28cd

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

kernel/trace/pid_list.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,9 @@ static inline bool upper_empty(union upper_chunk *chunk)
8181
{
8282
/*
8383
* If chunk->data has no lower chunks, it will be the same
84-
* as a zeroed bitmask. Use find_first_bit() to test it
85-
* and if it doesn't find any bits set, then the array
86-
* is empty.
84+
* as a zeroed bitmask.
8785
*/
88-
int bit = find_first_bit((unsigned long *)chunk->data,
89-
sizeof(chunk->data) * 8);
90-
return bit >= sizeof(chunk->data) * 8;
86+
return bitmap_empty((unsigned long *)chunk->data, BITS_PER_TYPE(chunk->data));
9187
}
9288

9389
static inline int pid_split(unsigned int pid, unsigned int *upper1,

0 commit comments

Comments
 (0)