Re: [PATCH v8 39/43] dyndbg: Ignore additional arguments from pr_fmt
From: sashiko-bot@kernel.org
Date: 2026-09-05 18:31:52
Also in:
dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Change pr_debug_ratelimited to pass 'fmt' instead of 'pr_fmt(fmt)' to avoid masking the true invocation error via an improper variadic sink in DEFINE_DYNAMIC_DEBUG_METADATA_CLS. -- commit 6b20b9b19031937bd627698de6352c6bfec6e4f6 Author: Philipp Hahn [off-list ref] dyndbg: Ignore additional arguments from pr_fmt This commit alters the DEFINE_DYNAMIC_DEBUG_METADATA_CLS macro to accept and discard variadic arguments. This is intended to workaround a build error when pr_debug_ratelimited is used with a pr_fmt that adds arguments.
quoted hunk ↗ jump to hunk
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index d00605ef651ec..82cde8e6b46cb 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h@@ -362,7 +362,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, dump_stack(); \ } -#define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt) \ +#define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt, ...) \
[Severity: Medium] Does taking variadic arguments here mask the underlying invocation error? By taking '...' and discarding the extra arguments, the metadata descriptor for pr_debug_ratelimited() incorrectly stores the prefixed format string (with unresolved format specifiers like "%s"), while pr_debug() stores the unprefixed format string. This inconsistency breaks dynamic debug format queries when a module redefines pr_fmt with multiple arguments. Should pr_debug_ratelimited() in include/linux/printk.h be changed to pass 'fmt' instead of 'pr_fmt(fmt)' to DEFINE_DYNAMIC_DEBUG_METADATA(), similar to how dev_dbg_ratelimited() handles it, rather than altering the metadata macro to silently drop arguments? -- Sashiko AI review · https://sashiko.dev/#/patchset/20260905-dd-cmap-part2-clean-v8-0-a4cc0674f6fd@gmail.com?part=39