Skip to contentSkip to conversation

nbd: printk format warning

PATCH Applied Randy.Dunlap 6 participants 12 messages Aug 7, 2006 – Aug 8, 2006

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

PATCH 1/5 nbd: printk format warning

From: Randy Dunlap <[email protected]>

Fix printk format warning(s):
drivers/block/nbd.c:410: warning: long unsigned int format, different type arg (arg 4)

---
 drivers/block/nbd.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/block/nbd.c +1 -1
@@ -407,7 +407,7 @@ static void do_nbd_request(request_queue
 		struct nbd_device *lo;
 
 		blkdev_dequeue_request(req);
-		dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%lx)\n",
+		dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%x)\n",
 				req->rq_disk->disk_name, req, req->cmd_type);
 
 		if (!blk_fs_request(req))

---

#1 lore raw

PATCH 2/5 cachefiles: printk format warning

From: Randy Dunlap <[email protected]>

Fix printk format warning(s):
fs/cachefiles/cf-proc.c:247: warning: int format, different type arg (arg 4)

---
 fs/cachefiles/cf-proc.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
fs/cachefiles/cf-proc.c +1 -1
@@ -244,7 +244,7 @@ static ssize_t cachefiles_proc_write(str
 
 error:
 	kfree(data);
-	_leave(" = %d", ret);
+	_leave(" = %Zd", ret);
 	return ret;
 
 found_command:

---

#2 lore raw

PATCH 3/5 MTD: printk format warning

From: Randy Dunlap <[email protected]>

Fix printk format warning(s):
drivers/mtd/mtd_blkdevs.c:72: warning: long int format, different type arg (arg 2)

---
 drivers/mtd/mtd_blkdevs.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/mtd_blkdevs.c +1 -1
@@ -69,7 +69,7 @@ static int do_blktrans_request(struct mt
 		return 1;
 
 	default:
-		printk(KERN_NOTICE "Unknown request %ld\n", rq_data_dir(req));
+		printk(KERN_NOTICE "Unknown request %d\n", rq_data_dir(req));
 		return 0;
 	}
 }

---

#3 lore raw

PATCH 4/5 scsi-target: printk format warnings

From: Randy Dunlap <[email protected]>

Fix printk format warning(s):
drivers/scsi/scsi_tgt_lib.c:96: warning: long unsigned int format, different type arg (arg 6) drivers/scsi/scsi_tgt_lib.c:293: warning: long unsigned int format, different type arg (arg 5) drivers/scsi/scsi_tgt_lib.c:305: warning: long unsigned int format, different type arg (arg 5) drivers/scsi/scsi_tgt_lib.c:344: warning: long unsigned int format, different type arg (arg 7) drivers/scsi/scsi_tgt_lib.c:553: warning: long unsigned int format, different type arg (arg 8

---
 drivers/scsi/scsi_tgt_lib.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/scsi_tgt_lib.c +5 -5
@@ -93,7 +93,7 @@ static void scsi_tgt_cmd_destroy(void *d
 	struct scsi_tgt_queuedata *qdata = cmd->request->q->queuedata;
 	unsigned long flags;
 
-	dprintk("cmd %p %d %lu\n", cmd, cmd->sc_data_direction,
+	dprintk("cmd %p %d %u\n", cmd, cmd->sc_data_direction,
 		rq_data_dir(cmd->request));
 
 	spin_lock_irqsave(&qdata->cmd_hash_lock, flags);
@@ -290,7 +290,7 @@ static void scsi_tgt_cmd_done(struct scs
 {
 	struct scsi_tgt_cmd *tcmd = cmd->request->end_io_data;
 
-	dprintk("cmd %p %lu\n", cmd, rq_data_dir(cmd->request));
+	dprintk("cmd %p %u\n", cmd, rq_data_dir(cmd->request));
 
 	scsi_tgt_uspace_send_status(cmd, GFP_ATOMIC);
 	INIT_WORK(&tcmd->work, scsi_tgt_cmd_destroy, cmd);
@@ -302,7 +302,7 @@ static int __scsi_tgt_transfer_response(
 	struct Scsi_Host *shost = scsi_tgt_cmd_to_host(cmd);
 	int err;
 
-	dprintk("cmd %p %lu\n", cmd, rq_data_dir(cmd->request));
+	dprintk("cmd %p %u\n", cmd, rq_data_dir(cmd->request));
 
 	err = shost->hostt->transfer_response(cmd, scsi_tgt_cmd_done);
 	switch (err) {
@@ -341,7 +341,7 @@ static int scsi_tgt_init_cmd(struct scsi
 
 	cmd->request_bufflen = rq->data_len;
 
-	dprintk("cmd %p addr %p cnt %d %lu\n", cmd, tcmd->buffer, cmd->use_sg,
+	dprintk("cmd %p addr %p cnt %d %u\n", cmd, tcmd->buffer, cmd->use_sg,
 		rq_data_dir(rq));
 	count = blk_rq_map_sg(rq->q, rq, cmd->request_buffer);
 	if (likely(count <= cmd->use_sg)) {
@@ -550,7 +550,7 @@ int scsi_tgt_kspace_exec(int host_no, u3
 	}
 	cmd = rq->special;
 
-	dprintk("cmd %p result %d len %d bufflen %u %lu %x\n", cmd,
+	dprintk("cmd %p result %d len %d bufflen %u %u %x\n", cmd,
 		result, len, cmd->request_bufflen, rq_data_dir(rq), cmd->cmnd[0]);
 
 	if (result == TASK_ABORTED) {

---

#4 lore raw

PATCH 5/5 usbnet: printk format warning

From: Randy Dunlap <[email protected]>

Fix printk format warning(s):
drivers/usb/net/usbnet.c:654: warning: int format, different type arg (arg 3)

Can't say that I understand this one...

---
 drivers/usb/net/usbnet.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/usb/net/usbnet.c +1 -1
@@ -652,7 +652,7 @@ static int usbnet_open (struct net_devic
 			framing = "simple";
 
 		devinfo (dev, "open: enable queueing "
-				"(rx %d, tx %d) mtu %d %s framing",
+				"(rx %ld, tx %d) mtu %u %s framing",
 			RX_QLEN (dev), TX_QLEN (dev), dev->net->mtu,
 			framing);
 	}

---

#5 lore raw

patch usbnet-printk-format-warning.patch added to gregkh-2.6 tree

This is a note to let you know that I've just added the patch titled

Subject: usbnet: printk format warning

to my gregkh-2.6 tree. Its filename is

usbnet-printk-format-warning.patch

This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/

Quoted 1 line

From [email protected] Mon Aug 7 15:56:22 2006

Date: Mon, 7 Aug 2006 15:56:40 -0700
From: "Randy.Dunlap" <[email protected]>
To: lkml <[email protected]>
Cc: akpm <[email protected]>, gregkh <[email protected]>
Subject: usbnet: printk format warning
Message-Id: <[email protected]>

From: Randy Dunlap <[email protected]>

Fix printk format warning(s):
drivers/usb/net/usbnet.c:654: warning: int format, different type arg (arg 3)

Can't say that I understand this one...

---
 drivers/usb/net/usbnet.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/net/usbnet.c +1 -1
@@ -652,7 +652,7 @@ static int usbnet_open (struct net_devic
 			framing = "simple";
 
 		devinfo (dev, "open: enable queueing "
-				"(rx %d, tx %d) mtu %d %s framing",
+				"(rx %ld, tx %d) mtu %u %s framing",
 			RX_QLEN (dev), TX_QLEN (dev), dev->net->mtu,
 			framing);
 	}

Patches currently in gregkh-2.6 which might be from [email protected] are

driver/driver-core-fix-driver-core-kernel-doc.patch driver/debugfs-kernel-doc-fixes-for-debugfs.patch usb/usbnet-printk-format-warning.patch

#6 lore raw

Re: [PATCH -mm 5/5] usbnet: printk format warning

In reply to Randy.Dunlap
Quoted 13 lines · On Mon, 7 Aug 2006 15:56:40 -0700 "Randy.Dunlap" <[email protected]> wrote:

Fix printk format warning(s):
drivers/usb/net/usbnet.c:654: warning: int format, different type arg (arg 3)

Can't say that I understand this one...

---
 drivers/usb/net/usbnet.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

drivers/usb/net/usbnet.c static int usbnet_open (struct net_devic · line 657

Quoted 7 lines
drivers/usb/net/usbnet.c +1 -1
@@ -652,7 +652,7 @@ static int usbnet_open (struct net_devic
 			framing = "simple";
 
 		devinfo (dev, "open: enable queueing "
-				"(rx %d, tx %d) mtu %d %s framing",
+				"(rx %ld, tx %d) mtu %u %s framing",
 			RX_QLEN (dev), TX_QLEN (dev), dev->net->mtu,
 			framing);

Your compiler wasn't very helpful. Or maybe we get better diagnostics with a 64-bit compiler:

From: Randy Dunlap <[email protected]>

Fix printk format warning(s):

drivers/usb/net/usbnet.c: In function 'usbnet_open':
drivers/usb/net/usbnet.c:654: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'

The fact that rx_urb_size happens to be a size_t has propagated all the way back to this printk. It's fragile to be using %z in this case - let's just typecast the args instead.

---

 drivers/usb/net/usbnet.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/net/usbnet.c renamed from drivers/usb/net/usbnet.c~usbnet-printk-format-warning +1 -1
diff -puN drivers/usb/net/usbnet.c~usbnet-printk-format-warning drivers/usb/net/usbnet.c
@@ -653,7 +653,7 @@ static int usbnet_open (struct net_devic
 
 		devinfo (dev, "open: enable queueing "
 				"(rx %d, tx %d) mtu %d %s framing",
-			RX_QLEN (dev), TX_QLEN (dev), dev->net->mtu,
+			(int)RX_QLEN(dev), (int)TX_QLEN(dev), dev->net->mtu,
 			framing);
 	}
 

_

maintainer Applied
#7 lore raw

Re: [PATCH -mm 2/5] cachefiles: printk format warning

In reply to Randy.Dunlap
Quoted 2 lines · Randy.Dunlap

Fix printk format warning(s):
fs/cachefiles/cf-proc.c:247: warning: int format, different type arg (arg 4)

Applied, thanks.

David

#8 lore raw
In reply to Randy.Dunlap

Hi!

Quoted 3 lines

Fix printk format warning(s):
drivers/block/nbd.c:410: warning: long unsigned int format, different type arg (arg 4)

ACK, but notice that we have new nbd maintainer... for a few years now.

Pavel

Quoted 19 lines
---
 drivers/block/nbd.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/block/nbd.c +1 -2
@@ -407,7 +407,7 @@ static void do_nbd_request(request_queue
 		struct nbd_device *lo;
 
 		blkdev_dequeue_request(req);
-		dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%lx)\n",
+		dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%x)\n",
 				req->rq_disk->disk_name, req, req->cmd_type);
 
 		if (!blk_fs_request(req))
 
 
---
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#9 lore raw
Quoted 8 lines · On Tue, 8 Aug 2006 01:07:26 +0200 Pavel Machek wrote:

Hi!

Quoted 3 lines

Fix printk format warning(s):
drivers/block/nbd.c:410: warning: long unsigned int format, different type arg (arg 4)

ACK, but notice that we have new nbd maintainer... for a few years now.

Please notice that I could not find that info in either of MAINTAINERS or CREDITS.... :(

Please have him/her send a patch.

Quoted 17 lines

Pavel

Quoted 15 lines
---
 drivers/block/nbd.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/block/nbd.c +1 -1
@@ -407,7 +407,7 @@ static void do_nbd_request(request_queue
 		struct nbd_device *lo;
 
 		blkdev_dequeue_request(req);
-		dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%lx)\n",
+		dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%x)\n",
 				req->rq_disk->disk_name, req, req->cmd_type);
 
Quoted 4 lines

drivers/block/nbd.c static void do_nbd_request(request_queue

Quoted 4 lines
drivers/block/nbd.c +0 -1
 		if (!blk_fs_request(req))
 
 
---

---
~Randy

#10 lore raw
Quoted 8 lines · Randy.Dunlap
Quoted 6 lines · On Tue, 8 Aug 2006 01:07:26 +0200 Pavel Machek wrote:

Hi!

Quoted 3 lines

Fix printk format warning(s):
drivers/block/nbd.c:410: warning: long unsigned int format, different type arg (arg 4)

Quoted 7 lines
Quoted 2 lines

ACK, but notice that we have new nbd maintainer... for a few years now.

Please notice that I could not find that info in either of MAINTAINERS or CREDITS.... :(

Please have him/her send a patch.

No, I think you can push the patch, or make it go through akpm.

It is in maintainers, but perhaps we need to add (NBD) there to help grep?

NETWORK BLOCK DEVICE

P:      Paul Clements
M:      [email protected]
S:      Maintained

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#11 lore raw
Quoted 15 lines · On Tue, 8 Aug 2006 01:31:51 +0200 Pavel Machek wrote:
Quoted 14 lines · Randy.Dunlap
Quoted 8 lines · On Tue, 8 Aug 2006 01:07:26 +0200 Pavel Machek wrote:

Hi!

Quoted 3 lines

Fix printk format warning(s):
drivers/block/nbd.c:410: warning: long unsigned int format, different type arg (arg 4)

ACK, but notice that we have new nbd maintainer... for a few years now.

Please notice that I could not find that info in either of MAINTAINERS or CREDITS.... :(

Quoted 6 lines
Quoted 1 line

Please have him/her send a patch.

No, I think you can push the patch, or make it go through akpm.

It is in maintainers, but perhaps we need to add (NBD) there to help grep?

OK, yes, sorry about that. I did grep for /NBD/. :)

Quoted 4 lines

NETWORK BLOCK DEVICE

P:      Paul Clements
M:      [email protected]
S:      Maintained

---
~Randy