[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen/lib: Annotate debugtrace_printk() with a printf compiler __attribute__



And fix up the resulting compilation issue.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Tim Deegan <tim@xxxxxxx>
---
 xen/arch/x86/mm/p2m.c |    2 +-
 xen/include/xen/lib.h |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 2c7bc0f..bca9f0f 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1807,7 +1807,7 @@ void audit_p2m(struct domain *d,
  
     P2M_PRINTK("p2m audit complete\n");
     if ( orphans_count | mpbad | pmbad )
-        P2M_PRINTK("p2m audit found %lu orphans\n", orphans);
+        P2M_PRINTK("p2m audit found %lu orphans\n", orphans_count);
     if ( mpbad | pmbad )
     {
         P2M_PRINTK("p2m audit found %lu odd p2m, %lu bad m2p entries\n",
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index e81b80e..f11b49e 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -75,7 +75,8 @@ int parse_bool(const char *s);
 /*#define DEBUG_TRACE_DUMP*/
 #ifdef DEBUG_TRACE_DUMP
 extern void debugtrace_dump(void);
-extern void debugtrace_printk(const char *fmt, ...);
+extern void debugtrace_printk(const char *fmt, ...)
+    __attribute__ ((format (printf, 1, 2)));
 #else
 #define debugtrace_dump()          ((void)0)
 #define debugtrace_printk(_f, ...) ((void)0)
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.