Skip to contentSkip to conversation

ath6kl: fix size_t printf warnings

PATCH In review Kalle Valo 2 participants 3 messages Mar 19, 2013 Atheros ATH6KL wireless driver

lore
Share & tools
lore

Kalle Valo

author
#0 lore raw

PATCH 1/1 ath6kl: fix size_t printf warnings

My new tracing code for ath6kl introduced these warnings on 64-bit:

trace.h:38:1: warning: format '%d' expects argument of type 'int',
but argument 4 has type 'size_t' [-Wformat]
trace.h:61:1: warning: format '%d' expects argument of type 'int',
but argument 4 has type 'size_t' [-Wformat]
trace.h:84:1: warning: format '%d' expects argument of type 'int',
but argument 6 has type 'size_t' [-Wformat]
trace.h:119:1: warning: format '%d' expects argument of type 'int',
but argument 7 has type 'size_t' [-Wformat]
trace.h:173:1: warning: format '%d' expects argument of type 'int',
but argument 3 has type 'size_t' [-Wformat]
trace.h:193:1: warning: format '%d' expects argument of type 'int',
but argument 5 has type 'size_t' [-Wformat]
trace.h:221:1: warning: format '%d' expects argument of type 'int',
but argument 5 has type 'size_t' [-Wformat]

Fix them by using %zd.

---
 drivers/net/wireless/ath/ath6kl/trace.h |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath6kl/trace.h +7 -7
index 6af6fa0..1a1ea78 100644
@@ -53,7 +53,7 @@ TRACE_EVENT(ath6kl_wmi_cmd,
 	),
 
 	TP_printk(
-		"id %d len %d",
+		"id %d len %zd",
 		__entry->id, __entry->buf_len
 	)
 );
@@ -76,7 +76,7 @@ TRACE_EVENT(ath6kl_wmi_event,
 	),
 
 	TP_printk(
-		"id %d len %d",
+		"id %d len %zd",
 		__entry->id, __entry->buf_len
 	)
 );
@@ -108,7 +108,7 @@ TRACE_EVENT(ath6kl_sdio,
 	),
 
 	TP_printk(
-		"%s addr 0x%x flags 0x%x len %d\n",
+		"%s addr 0x%x flags 0x%x len %zd\n",
 		__entry->tx ? "tx" : "rx",
 		__entry->addr,
 		__entry->flags,
@@ -161,7 +161,7 @@ TRACE_EVENT(ath6kl_sdio_scat,
 	),
 
 	TP_printk(
-		"%s addr 0x%x flags 0x%x entries %d total_len %d\n",
+		"%s addr 0x%x flags 0x%x entries %d total_len %zd\n",
 		__entry->tx ? "tx" : "rx",
 		__entry->addr,
 		__entry->flags,
@@ -186,7 +186,7 @@ TRACE_EVENT(ath6kl_sdio_irq,
 	),
 
 	TP_printk(
-		"irq len %d\n", __entry->buf_len
+		"irq len %zd\n", __entry->buf_len
 	)
 );
 
@@ -211,7 +211,7 @@ TRACE_EVENT(ath6kl_htc_rx,
 	),
 
 	TP_printk(
-		"status %d endpoint %d len %d\n",
+		"status %d endpoint %d len %zd\n",
 		__entry->status,
 		__entry->endpoint,
 		__entry->buf_len
@@ -239,7 +239,7 @@ TRACE_EVENT(ath6kl_htc_tx,
 	),
 
 	TP_printk(
-		"status %d endpoint %d len %d\n",
+		"status %d endpoint %d len %zd\n",
 		__entry->status,
 		__entry->endpoint,
 		__entry->buf_len
author
#1 lore raw
Quoted 17 lines · Kalle Valo

My new tracing code for ath6kl introduced these warnings on 64-bit:

trace.h:38:1: warning: format '%d' expects argument of type 'int',
but argument 4 has type 'size_t' [-Wformat]
trace.h:61:1: warning: format '%d' expects argument of type 'int',
but argument 4 has type 'size_t' [-Wformat]
trace.h:84:1: warning: format '%d' expects argument of type 'int',
but argument 6 has type 'size_t' [-Wformat]
trace.h:119:1: warning: format '%d' expects argument of type 'int',
but argument 7 has type 'size_t' [-Wformat]
trace.h:173:1: warning: format '%d' expects argument of type 'int',
but argument 3 has type 'size_t' [-Wformat]
trace.h:193:1: warning: format '%d' expects argument of type 'int',
but argument 5 has type 'size_t' [-Wformat]
trace.h:221:1: warning: format '%d' expects argument of type 'int',
but argument 5 has type 'size_t' [-Wformat]

Quoted 4 lines

Fix them by using %zd.

John, can you take this directly so that we can fix the build warnings on your tree?

Signature · 1 line
Kalle Valo
#2 lore raw
Quoted 19 lines · Kalle Valo
Quoted 17 lines · Kalle Valo

My new tracing code for ath6kl introduced these warnings on 64-bit:

trace.h:38:1: warning: format '%d' expects argument of type 'int',
but argument 4 has type 'size_t' [-Wformat]
trace.h:61:1: warning: format '%d' expects argument of type 'int',
but argument 4 has type 'size_t' [-Wformat]
trace.h:84:1: warning: format '%d' expects argument of type 'int',
but argument 6 has type 'size_t' [-Wformat]
trace.h:119:1: warning: format '%d' expects argument of type 'int',
but argument 7 has type 'size_t' [-Wformat]
trace.h:173:1: warning: format '%d' expects argument of type 'int',
but argument 3 has type 'size_t' [-Wformat]
trace.h:193:1: warning: format '%d' expects argument of type 'int',
but argument 5 has type 'size_t' [-Wformat]
trace.h:221:1: warning: format '%d' expects argument of type 'int',
but argument 5 has type 'size_t' [-Wformat]

Quoted 7 lines
Quoted 4 lines

Fix them by using %zd.

John, can you take this directly so that we can fix the build warnings on your tree?

I'll take it, thanks -- may be several hours...

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.