Skip to contentSkip to conversation

iscsi: Fix some debug printf types

PATCH In review Boaz Harrosh 4 participants 4 messages Jan 12, 2009 – Feb 8, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iscsi: Fix some debug printf types

A couple of prints at lib/iscsi_tcp had the %Z missing from the kprint format string. Just to show that debug_prints are not enabled much.

---
 drivers/scsi/iscsi_tcp.c    |    2 +-
 drivers/scsi/libiscsi_tcp.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/iscsi_tcp.c +1 -1
index 23808df..a566aa9 100644
@@ -415,7 +415,7 @@ iscsi_sw_tcp_send_linear_data_prep(struct iscsi_conn *conn, void *data,
 	struct hash_desc *tx_hash = NULL;
 	unsigned int hdr_spec_len;
 
-	debug_tcp("%s(%p, datalen=%d%s)\n", __func__, tcp_conn, len,
+	debug_tcp("%s(%p, datalen=%Zd%s)\n", __func__, tcp_conn, len,
 		  conn->datadgst_en? ", digest enabled" : "");
 
 	/* Make sure the datalen matches what the caller
drivers/scsi/libiscsi_tcp.c +1 -1
index a745f91..12354c5 100644
@@ -356,7 +356,7 @@ iscsi_segment_seek_sg(struct iscsi_segment *segment,
 	struct scatterlist *sg;
 	unsigned int i;
 
-	debug_scsi("iscsi_segment_seek_sg offset %u size %llu\n",
+	debug_scsi("iscsi_segment_seek_sg offset %u size %Zu\n",
 		  offset, size);
 	__iscsi_segment_init(segment, size, done, hash);
 	for_each_sg(sg_list, sg, sg_count, i) {
Signature · 1 line
1.6.0.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

My man page for (glibc) printf says that "Z" is specific to libc5, and
that "z" is better -- man -P 'less -p" z "' fprintf Does the underlying
printf support "Z" rather than "z"?

QOTD>>
z
A following integer conversion corresponds to a size_t or ssize_t argument. (Linux libc5 has Z with this meaning. Don't use it.)

&:-)

Quoted 36 lines · On Monday 12 January 2009 17:30:34 Boaz Harrosh wrote:

A couple of prints at lib/iscsi_tcp had the %Z missing from the kprint format string. Just to show that debug_prints are not enabled much.

---
 drivers/scsi/iscsi_tcp.c    |    2 +-
 drivers/scsi/libiscsi_tcp.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/iscsi_tcp.c +1 -1
index 23808df..a566aa9 100644
@@ -415,7 +415,7 @@ iscsi_sw_tcp_send_linear_data_prep(struct iscsi_conn
 *conn, void *data, struct hash_desc *tx_hash = NULL;
 	unsigned int hdr_spec_len;
 
-	debug_tcp("%s(%p, datalen=%d%s)\n", __func__, tcp_conn, len,
+	debug_tcp("%s(%p, datalen=%Zd%s)\n", __func__, tcp_conn, len,
 		  conn->datadgst_en? ", digest enabled" : "");
 
 	/* Make sure the datalen matches what the caller
drivers/scsi/libiscsi_tcp.c +1 -1
index a745f91..12354c5 100644
@@ -356,7 +356,7 @@ iscsi_segment_seek_sg(struct iscsi_segment *segment,
 	struct scatterlist *sg;
 	unsigned int i;
 
-	debug_scsi("iscsi_segment_seek_sg offset %u size %llu\n",
+	debug_scsi("iscsi_segment_seek_sg offset %u size %Zu\n",
 		  offset, size);
 	__iscsi_segment_init(segment, size, done, hash);
 	for_each_sg(sg_list, sg, sg_count, i) {
#3 lore raw
Quoted 10 lines · Andrew McGill

My man page for (glibc) printf says that "Z" is specific to libc5, and
that "z" is better -- man -P 'less -p" z "' fprintf Does the underlying
printf support "Z" rather than "z"?

QOTD>>
z
A following integer conversion corresponds to a size_t or ssize_t argument. (Linux libc5 has Z with this meaning. Don't use it.)

&:-)

Agreed. We are trying to use small z instead of big Z in Linux since small z is ANSI C.

Quoted 38 lines · On Monday 12 January 2009 17:30:34 Boaz Harrosh wrote:
Quoted 36 lines

A couple of prints at lib/iscsi_tcp had the %Z missing from the kprint format string. Just to show that debug_prints are not enabled much.

---
 drivers/scsi/iscsi_tcp.c    |    2 +-
 drivers/scsi/libiscsi_tcp.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/iscsi_tcp.c +1 -1
index 23808df..a566aa9 100644
@@ -415,7 +415,7 @@ iscsi_sw_tcp_send_linear_data_prep(struct iscsi_conn
 *conn, void *data, struct hash_desc *tx_hash = NULL;
 	unsigned int hdr_spec_len;
 
-	debug_tcp("%s(%p, datalen=%d%s)\n", __func__, tcp_conn, len,
+	debug_tcp("%s(%p, datalen=%Zd%s)\n", __func__, tcp_conn, len,
 		  conn->datadgst_en? ", digest enabled" : "");
 
 	/* Make sure the datalen matches what the caller
drivers/scsi/libiscsi_tcp.c +1 -1
index a745f91..12354c5 100644
@@ -356,7 +356,7 @@ iscsi_segment_seek_sg(struct iscsi_segment *segment,
 	struct scatterlist *sg;
 	unsigned int i;
 
-	debug_scsi("iscsi_segment_seek_sg offset %u size %llu\n",
+	debug_scsi("iscsi_segment_seek_sg offset %u size %Zu\n",
 		  offset, size);
 	__iscsi_segment_init(segment, size, done, hash);
 	for_each_sg(sg_list, sg, sg_count, i) {
Signature · 1 line
~Randy
#4 lore raw
In reply to Boaz Harrosh
Quoted 16 lines · Boaz Harrosh

A couple of prints at lib/iscsi_tcp had the %Z missing from the kprint format string. Just to show that debug_prints are not enabled much.

---
 drivers/scsi/iscsi_tcp.c    |    2 +-
 drivers/scsi/libiscsi_tcp.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/iscsi_tcp.c +0 -0
index 23808df..a566aa9 100644

drivers/scsi/iscsi_tcp.c iscsi_sw_tcp_send_linear_data_prep(struct iscsi_conn *conn, void *data, · line 420

Quoted 7 lines
drivers/scsi/iscsi_tcp.c +1 -1
@@ -415,7 +415,7 @@ iscsi_sw_tcp_send_linear_data_prep(struct iscsi_conn *conn, void *data,
 	struct hash_desc *tx_hash = NULL;
 	unsigned int hdr_spec_len;
 
-	debug_tcp("%s(%p, datalen=%d%s)\n", __func__, tcp_conn, len,
+	debug_tcp("%s(%p, datalen=%Zd%s)\n", __func__, tcp_conn, len,
 		  conn->datadgst_en? ", digest enabled" : "");
 

I got these fixed when I did the modparam debug patch.

I used a lower case z (%zd) though. I thought I saw that in a review comment from Andrew Morton or in a kernel janitor patch, so I thought that was the preferred way to do it in kernel code, but was not 100% sure. Let me know if I goofed and I will fix it.

Thanks.