for_each_if(9)
β¨ 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms