Skip to contentSkip to conversation

x86/platform/intel/quark: add printf attribute to imr_self_test_result()

PATCH In review Nicolas Iooss 3 participants 3 messages Dec 19, 2016 – Dec 20, 2016 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/platform/intel/quark: add printf attribute to imr_self_test_result()

__printf attributes help detecting issues in printf format strings at compile time.

Even though imr_selftest.c is only compiled with CONFIG_DEBUG_IMR_SELFTEST, gcc complains about a missing format attribute when compiling allmodconfig with -Wmissing-format-attribute. Silent this warning by adding the attribute.

---
 arch/x86/platform/intel-quark/imr_selftest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/platform/intel-quark/imr_selftest.c +2 -1
index f5bad40936ac..b8f562049cad 100644
@@ -25,7 +25,8 @@
  * @fmt:	format string.
  * ...		variadic argument list.
  */
-static void __init imr_self_test_result(int res, const char *fmt, ...)
+static __printf(2, 3)
+void __init imr_self_test_result(int res, const char *fmt, ...)
 {
 	va_list vlist;
 
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines · Nicolas Iooss

__printf attributes help detecting issues in printf format strings at compile time.

Even though imr_selftest.c is only compiled with CONFIG_DEBUG_IMR_SELFTEST, gcc complains about a missing format attribute when compiling allmodconfig with -Wmissing-format-attribute. Silent this warning by adding the attribute.

---
 arch/x86/platform/intel-quark/imr_selftest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/platform/intel-quark/imr_selftest.c +0 -0
index f5bad40936ac..b8f562049cad 100644

arch/x86/platform/intel-quark/imr_selftest.c line 32

Quoted 9 lines
arch/x86/platform/intel-quark/imr_selftest.c +2 -1
@@ -25,7 +25,8 @@
  * @fmt:	format string.
  * ...		variadic argument list.
  */
-static void __init imr_self_test_result(int res, const char *fmt, ...)
+static __printf(2, 3)
+void __init imr_self_test_result(int res, const char *fmt, ...)
 {
 	va_list vlist;
 

since I wrote this code.

cheers

---
bod

#2 lore raw

[tip:x86/urgent] x86/platform/intel/quark: Add printf attribute to imr_self_test_result()

In reply to Nicolas Iooss
x86/platform/intel/quark: Add printf attribute to imr_self_test_result()
Commit-ID:  9120cf4fd9ae77245ce9137869bcbd16575cc633
Gitweb:     http://git.kernel.org/tip/9120cf4fd9ae77245ce9137869bcbd16575cc633
Author:     Nicolas Iooss <[email protected]>
AuthorDate: Mon, 19 Dec 2016 14:21:44 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 20 Dec 2016 09:37:24 +0100

x86/platform/intel/quark: Add printf attribute to imr_self_test_result()

__printf() attributes help detecting issues in printf() format strings at compile time.

Even though imr_selftest.c is only compiled with CONFIG_DEBUG_IMR_SELFTEST=y, GCC complains about a missing format attribute when compiling allmodconfig with -Wmissing-format-attribute.

Silence this warning by adding the attribute.

---
 arch/x86/platform/intel-quark/imr_selftest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/platform/intel-quark/imr_selftest.c +2 -1
index f5bad40..b8f5620 100644
@@ -25,7 +25,8 @@
  * @fmt:	format string.
  * ...		variadic argument list.
  */
-static void __init imr_self_test_result(int res, const char *fmt, ...)
+static __printf(2, 3)
+void __init imr_self_test_result(int res, const char *fmt, ...)
 {
 	va_list vlist;