how to properly use BUILD_BUG_ON_MSG ?

jim.cromie at gmail.com jim.cromie at gmail.com
Mon Aug 30 17:17:00 EDT 2021


trimming out the "noise", Im left with

>    39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>       |                                     ^~~~~~~~~~~~~~~~~~
> /home/jimc/projects/lx/wk-next/include/linux/dynamic_debug.h:283:9:
> note: in expansion of macro ‘BUILD_BUG_ON_MSG’
>   283 |         BUILD_BUG_ON_MSG(1, "you need -DDYNAMIC_DEBUG_MODULE
> in compile")
>       |         ^~~~~~~~~~~~~~~~
> /home/jimc/projects/lx/wk-next/drivers/gpu/drm/drm_print.c:60:1: note:
> in expansion of macro ‘DEFINE_DYNAMIC_DEBUG_CATEGORIES’
>    60 | DEFINE_DYNAMIC_DEBUG_CATEGORIES(debug, __drm_debug,
>       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>


So, following that advice, I added

--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -20,6 +20,9 @@ drm-y       :=        drm_aperture.o drm_auth.o drm_cache.o \
                drm_client_modeset.o drm_atomic_uapi.o drm_hdcp.o \
                drm_managed.o drm_vblank_work.o

+#ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG
+ccflags-y += -DDYNAMIC_DEBUG_MODULE
+#endif
 drm-$(CONFIG_DRM_LEGACY) += drm_agpsupport.o drm_bufs.o drm_context.o
drm_dma.o \


that fixed the error, and makes the BUILD_BUG usage look good.

so I withdraw the question



More information about the Kernelnewbies mailing list