Skip to content

Commit bd77910

Browse files
yamahatasean-jc
authored andcommitted
KVM: selftests: Add printf attribute to _no_printf()
Annotate the KVM selftests' _no_printf() with the printf format attribute so that the compiler can help check parameters provided to pr_debug() and pr_info() irrespective of DEBUG and QUIET being defined. [reinette: move attribute right after storage class, rework changelog] Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Link: https://lore.kernel.org/r/898ec01580f6f4af5655805863239d6dce0d3fb3.1734128510.git.reinette.chatre@intel.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 3cd19f1 commit bd77910

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/kvm/include/test_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#define msecs_to_usecs(msec) ((msec) * 1000ULL)
2424

25-
static inline int _no_printf(const char *format, ...) { return 0; }
25+
static inline __printf(1, 2) int _no_printf(const char *format, ...) { return 0; }
2626

2727
#ifdef DEBUG
2828
#define pr_debug(...) printf(__VA_ARGS__)

0 commit comments

Comments
 (0)