mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
drm/amd/display: Model ASSERT as path terminator
[WHAT] ASSERT() and ASSERT_CRITICAL() expand to a WARN_ON() test that falls through, because dc_breakpoint() is a no-op unless CONFIG_DEBUG_KERNEL_DC is set. Static analysers read that test as proof the asserted condition can fail, then keep walking the failing path because nothing stops it. The assert therefore manufactures the very defect it guards against, and Coverity reports DIVIDE_BY_ZERO defects whose entire path is the assert itself. [HOW] Redefine both macros to call a declaration-only __coverity_panic__() when the asserted condition fails, which marks the failing path as unreachable and leaves only genuinely reachable defects. The override is guarded by __COVERITY__, which is defined only while the analyser captures the build, so the code emitted by a normal build is unchanged. Assisted-by: Copilot:Claude-Opus-5 Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
342280aae4
commit
8e0822223a
1 changed files with 18 additions and 0 deletions
Loading…
Add table
Add a link
Reference in a new issue