member_address_is_nonnull(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… member_address_is_nonnull(9) πŸ’…

Kernel API Manual bestie, we’re doing a vibe check on a member address β€” is it NULL or not? 🫢✨

🌸 NAME 🌸

member_address_is_nonnull β€” check whether the member address is not NULL πŸ’–

✨ SYNOPSIS ✨

member_address_is_nonnull (ptr , member );

πŸŽ€ ARGUMENTS πŸŽ€

  • ptr β€” the object pointer (a struct type * that contains the llist_node) πŸ¦‹
  • member β€” the name of the llist_node within the struct ✨

πŸ’… DESCRIPTION πŸ’…

Okay so this macro is conceptually the same as ptr->member != NULL, but it works around the fact that compilers can decide that taking a member address is never a NULL pointer. 😭

Real objects that start at a high address and have a member at NULL are unlikely to exist, but such pointers may be returned e.g. by the container_of macro. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/linux/llist.h: init_llist_head(9), init_llist_node(9), llist_on_list(9), llist_entry(9), llist_for_each(9), llist_for_each_safe(9), llist_for_each_entry(9), llist_for_each_entry_safe(9), llist_empty(9), llist_add_batch(9), llist_add(9), llist_del_all(9), llist_del_first_init(9) πŸ‘‘


cute little sign-off πŸ’– source/version: ./include/linux β€’ date: October 2026 β€’ manual: Kernel API Manual β€’ page: member_address_is_nonnull(9) ✨

πŸ“¦ where this page comes from