lkml.org 
[lkml]   [2025]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 1/3] drm/amd/display: Add ASSERT_BUG() macro definition
Date
In order to keep the current ability for the aim of debugging and avoid
printing the warning message twice, add ASSERT_BUG() macro definition to
harden the callers of division functions.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
drivers/gpu/drm/amd/display/dc/os_types.h | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/os_types.h b/drivers/gpu/drm/amd/display/dc/os_types.h
index f2ba76c1e0c0..f0f4e22b43cd 100644
--- a/drivers/gpu/drm/amd/display/dc/os_types.h
+++ b/drivers/gpu/drm/amd/display/dc/os_types.h
@@ -79,6 +79,13 @@
dc_breakpoint(); \
} while (0)

+#define ASSERT_BUG(expr) do { \
+ if (!(expr)) { \
+ dc_breakpoint(); \
+ BUG(); \
+ } \
+ } while (0)
+
#define BREAK_TO_DEBUGGER() \
do { \
DRM_DEBUG_DRIVER("%s():%d\n", __func__, __LINE__); \
--
2.42.0

\
 
 \ /
  Last update: 2025-01-14 14:31    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog