kunit_remove_action(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kunit_remove_action(9) β€” Kernel API Manual

okay bestie, welcome to the kunit girlies' corner of the kernel docs ✨ this little function is your "never mind, cancel that" button for deferred test cleanup, and honestly? iconic.


🌸 NAME

kunit_remove_action β€” cancel a matching deferred action. bye-bye, cleanup call 🫢


πŸŽ€ SYNOPSIS

void kunit_remove_action (struct kunit *test , kunit_action_t *action ,
void *ctx );

literally three things and you're done πŸ’…


πŸ¦‹ ARGUMENTS

  • test β€” the test case this action is associated with. it's her test, the action belongs to her πŸ‘‘
  • action β€” the deferred function you want to cancel. the one you're ghosting πŸ™ˆ
  • ctx β€” the context that gets passed to the deferred function to trigger it. like, the exact vibe that makes the match happen ✨

πŸ’– DESCRIPTION

so the whole point: you stop an action that was deferred via kunit_add_action from executing when the test terminates. no more surprise cleanup at the end of the test β€” you said no, and you meant it πŸ’€

⚠️ real talk though: if that function/context pair was deferred multiple times, only the most recent one gets cancelled. not all of them. just the newest one. the rest are still showing up to the party 😭 so don't come for me when your older registrations still fire β€” them's the rules, fr fr.

See also: devm_remove_action for the devres equivalent β€” same energy, different subsystem 🧚


⭐ SEE ALSO

Kernel file ./include/kunit/resource.h β€” yes, that's the header, go read it πŸ“

and the full resource squad, in formation:


🌈 that's the whole page, bestie β€” go forth and cancel your deferred actions responsibly πŸ’œ

sign-off era: this one lives in ./include/kunit, dated October 2026, and it's giving "kernel api manual" realness πŸŽ€ mwah πŸ’‹

πŸ“¦ where this page comes from