for_each_if(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, meet for_each_if β€” the little helper from the Kernel API Manual (yep, the for_each_if(9) page) for handling conditionals in various for_each macros. That's literally the whole vibe: helper for handling conditionals in various for_each macros. πŸŽ€

🌸 SYNOPSIS 🌸

for_each_if (condition );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • condition β€” the condition to check. That's it, that's the argument. πŸ’…

πŸ’– DESCRIPTION πŸ’–

Typical use, no cap:

#define for_each_foo_bar(x, y) Β΄
        list_for_each_entry(x, y->list, head) Β΄
                for_each_if(x->something == SOMETHING)

The for_each_if macro makes the use of for_each_foo_bar less error prone. slay, safety. ✨

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/util_macros.h β€” plus these iconic cross-references, bestie: find_closest(9), find_closest_descending(9), PTR_IF(9), u64_to_user_ptr(9), is_insidevar(9). 🫢


cute sign-off: the footer's source/version is ./include/linux, dated October 2026, and the page is for_each_if(9) β€” periodt πŸ’…πŸ’–

πŸ“¦ where this page comes from