Skip to contentSkip to conversation

ftrace: enable format arguments checking

PATCH In review Lai Jiangshan 2 participants 6 messages Dec 20, 2008 – Dec 24, 2008 ftrace

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ftrace: enable format arguments checking

format arguments checking for ftrace_printk() is __printf(1, 2), not __printf(1, 0).

---

include/linux/ftrace.h +1 -1
index 9c5bc6b..0c71788 100644
@@ -210,7 +210,7 @@ extern void ftrace_dump(void);
 static inline void
 ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
 static inline int
-ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0)));
+ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 
 static inline int
 ftrace_printk(const char *fmt, ...)
#1 lore raw
Quoted 10 lines · Lai Jiangshan

format arguments checking for ftrace_printk() is __printf(1, 2), not __printf(1, 0).

---

include/linux/ftrace.h +0 -0
index 9c5bc6b..0c71788 100644

include/linux/ftrace.h extern void ftrace_dump(void); · line 213

Quoted 4 lines
include/linux/ftrace.h +0 -1
@@ -210,7 +210,7 @@ extern void ftrace_dump(void);
 static inline void
 ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
 static inline int
-ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0)));

Hi, Steven Rostedt
Did you notice this patch?
This patch changed a char in a line: s/0/2/. It enables the format checking.

Lai.

Quoted 14 lines
include/linux/ftrace.h +1 -1
+ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 
 static inline int
 ftrace_printk(const char *fmt, ...)
 
 
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

maintainer
#2 lore raw
Quoted 20 lines · Lai Jiangshan
Quoted 10 lines · Lai Jiangshan

format arguments checking for ftrace_printk() is __printf(1, 2), not __printf(1, 0).

---

include/linux/ftrace.h +0 -0
index 9c5bc6b..0c71788 100644

include/linux/ftrace.h extern void ftrace_dump(void); · line 213

Quoted 4 lines
include/linux/ftrace.h +0 -1
@@ -210,7 +210,7 @@ extern void ftrace_dump(void);
 static inline void
 ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
 static inline int
-ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0)));

Hi, Steven Rostedt
Did you notice this patch?
This patch changed a char in a line: s/0/2/. It enables the format checking.

Quoted 7 lines

Lai.

Quoted 5 lines
include/linux/ftrace.h +1 -0
+ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 
 static inline int
 ftrace_printk(const char *fmt, ...)

Ah yes, sorry, I'm rushing to get some other things done because I'll be on holiday tomorrow through to Jan 5th.

I'll pull it into the rest of my next series.

-- Steve

maintainer
#3 lore raw
In reply to Lai Jiangshan

On Sat, 20 Dec 2008, Lai Jiangshan wrote:

Could you resubmit with a "Impact" line.

Thanks,

-- Steve

Quoted 23 lines

format arguments checking for ftrace_printk() is __printf(1, 2), not __printf(1, 0).

---

include/linux/ftrace.h +1 -1
index 9c5bc6b..0c71788 100644
@@ -210,7 +210,7 @@ extern void ftrace_dump(void);
 static inline void
 ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
 static inline int
-ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0)));
+ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 
 static inline int
 ftrace_printk(const char *fmt, ...)
#4 lore raw
Quoted 6 lines · Steven Rostedt

On Sat, 20 Dec 2008, Lai Jiangshan wrote:

Could you resubmit with a "Impact" line.

Thanks,

Impact: check format for ftrace_printk() when CONFIG_TRACING=n

format arguments checking for ftrace_printk() is __printf(1, 2), not __printf(1, 0).

---

include/linux/ftrace.h +1 -1
index 9c5bc6b..0c71788 100644
@@ -210,7 +210,7 @@ extern void ftrace_dump(void);
 static inline void
 ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
 static inline int
-ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0)));
+ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 
 static inline int
 ftrace_printk(const char *fmt, ...)
maintainer
#5 lore raw
Quoted 8 lines · Lai Jiangshan
Quoted 6 lines · Steven Rostedt

On Sat, 20 Dec 2008, Lai Jiangshan wrote:

Could you resubmit with a "Impact" line.

Thanks,

Quoted 6 lines

Impact: check format for ftrace_printk() when CONFIG_TRACING=n

format arguments checking for ftrace_printk() is __printf(1, 2), not __printf(1, 0).

Ingo already pulled this.

Thanks anyway.

-- Steve