Skip to contentSkip to conversation

W1 printk format warning

DISCUSSION Randy Dunlap 4 participants 5 messages Apr 25, 2007 – Apr 27, 2007 W1 dallas's 1-wire bus

lore
Share & tools
lore
#0 lore raw

in 2.6.21-rc7-mm1. Are you aware of this?

drivers/w1/w1.c:460: warning: too few arguments for format

	dev_dbg(&sl->dev, "%s: registering %s as %p.\n", __func__,
		&sl->dev.bus_id[0]);

Thanks,
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#1 lore raw
Quoted 7 lines · On Wed, 25 Apr 2007 16:21:04 -0700 Randy Dunlap <[email protected]> wrote:

in 2.6.21-rc7-mm1. Are you aware of this?

drivers/w1/w1.c:460: warning: too few arguments for format

	dev_dbg(&sl->dev, "%s: registering %s as %p.\n", __func__,
		&sl->dev.bus_id[0]);

Yeah, that's because Dan's dev_dbg-check-dev_dbg-arguments.patch added printk arg-checking to dev_dbg() and a bunch of bugs got exposed. I fixed a few of them.

Incidentally, there are at least four different drivers which privately do things like:

#if !defined(DEBUG)
#undef dev_dbg
static inline int __attribute__ ((format (printf, 2, 3))) dev_dbg(

	const struct device *_dev, const char *fmt, ...) {return 0;}

#endif

which can all be removed with Dan's (good) patch in place.

#2 lore raw
Quoted 6 lines · Andrew Morton
Quoted 4 lines · On Wed, 25 Apr 2007 16:21:04 -0700 Randy Dunlap <[email protected]> wrote:

in 2.6.21-rc7-mm1. Are you aware of this?

drivers/w1/w1.c:460: warning: too few arguments for format

Quoted 7 lines
Quoted 3 lines
	dev_dbg(&sl->dev, "%s: registering %s as %p.\n", __func__,
		&sl->dev.bus_id[0]);

Yeah, that's because Dan's dev_dbg-check-dev_dbg-arguments.patch added printk arg-checking to dev_dbg() and a bunch of bugs got exposed. I fixed a few of them.

Could you post a full list for w1, if there is only one, here is a fix.

Thanks a lot, Randy.

drivers/w1/w1.c +1 -1
index 63c0724..7d6876d 100644
@@ -459,7 +459,7 @@ static int __w1_attach_slave_device(struct w1_slave *sl)
 		 (unsigned long long) sl->reg_num.id);
 
 	dev_dbg(&sl->dev, "%s: registering %s as %p.\n", __func__,
-		&sl->dev.bus_id[0]);
+		&sl->dev.bus_id[0], sl);
 
 	err = device_register(&sl->dev);
 	if (err < 0) {
Signature · 1 line
	Evgeniy Polyakov
#3 lore raw
Quoted 11 lines · On Thu, 26 Apr 2007 22:17:44 +0400 Evgeniy Polyakov <[email protected]> wrote:
Quoted 10 lines · Andrew Morton
Quoted 7 lines · On Wed, 25 Apr 2007 16:21:04 -0700 Randy Dunlap <[email protected]> wrote:

in 2.6.21-rc7-mm1. Are you aware of this?

drivers/w1/w1.c:460: warning: too few arguments for format

	dev_dbg(&sl->dev, "%s: registering %s as %p.\n", __func__,
		&sl->dev.bus_id[0]);
Quoted 6 lines
Quoted 3 lines

Yeah, that's because Dan's dev_dbg-check-dev_dbg-arguments.patch added printk arg-checking to dev_dbg() and a bunch of bugs got exposed. I fixed a few of them.

Could you post a full list for w1, if there is only one, here is a fix.

There's only the one in w1, I think. I fixed a few more but I didn't actually go looking for more such errors.

#4 lore raw
Quoted 2 lines

From: Andrew Morton [mailto:[email protected]] On Thu, 26 Apr 2007 22:17:44 +0400 Evgeniy Polyakov

<[email protected]>

Quoted 5 lines
Quoted 1 line · wrote:

On Wed, Apr 25, 2007 at 04:45:09PM -0700, Andrew Morton (akpm@linux-

Quoted 1 line · foundation.org)
Quoted 1 line

On Wed, 25 Apr 2007 16:21:04 -0700 Randy Dunlap

<[email protected]>

Quoted 7 lines
Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines

in 2.6.21-rc7-mm1. Are you aware of this?

drivers/w1/w1.c:460: warning: too few arguments for format

	dev_dbg(&sl->dev, "%s: registering %s as %p.\n",

__func__,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
		&sl->dev.bus_id[0]);

Yeah, that's because Dan's dev_dbg-check-dev_dbg-arguments.patch

added

Quoted 1 line
Quoted 1 line
Quoted 1 line

printk arg-checking to dev_dbg() and a bunch of bugs got exposed.

I fixed

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

a few of them.

Could you post a full list for w1, if there is only one, here is a

fix.

Quoted 4 lines
Quoted 1 line

There's only the one in w1, I think. I fixed a few more but I didn't actually go looking for more such errors.

Feel free to bug me if there is more fallout that is not otherwise picked up...

--
Dan