kunit_is_suppressed_warning(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– kunit_is_suppressed_warning(9) πŸ’–

okay so this little icon is from the Kernel API Manual, and she is here to answer one very specific question: are warnings being suppressed by the current KUnit test? bestie, let’s get into it 🫢✨


✨ NAME ✨

kunit_is_suppressed_warning β€” check if warnings are being suppressed by the current KUnit test πŸ’…


🌸 SYNOPSIS 🌸

bool kunit_is_suppressed_warning (bool count );

πŸŽ€ ARGUMENTS πŸŽ€

  • count β€” if true, increment the suppression counter on match. periodt πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

Returns true if the current task has active warning suppression. It uses the kunit_running static branch for zero overhead when no tests are running. no cap, that’s the whole vibe check ⭐

A single WARN*() may traverse multiple call sites in the warning path (e.g., __warn_printk and __report_bug). So here’s the tea: pass count = true at the primary suppression point to count each warning exactly once, and pass count = false at secondary points to suppress output without inflating the count. literally the main character energy of keeping the count correct πŸ‘‘πŸ”₯


🌈 SEE ALSO 🌈


mwah πŸ’‹ β€” source/version: ./include/kunit, dated October 2026. bye bestie, go count those warnings correctly πŸ§šπŸ’œ

πŸ“¦ where this page comes from