diff mbox

[2.6.29-rc] usbnet: allow type check of devdbg arguments in non-debug build

Message ID 200901162319.44255.david-b@pacbell.net
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

David Brownell Jan. 17, 2009, 7:19 a.m. UTC
From: Steve Glendinning <steve.glendinning@smsc.com>
Subject: usbnet: allow type check of devdbg arguments in non-debug build

Improve usbnet's devdbg to always type-check diagnostic arguments,
like dev_dbg (device.h).  This makes no change to the resulting size of
usbnet modules.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
[ refreshed against 2.6.29-rc1 GIT ]

 include/linux/usb/usbnet.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Jan. 20, 2009, 1:12 a.m. UTC | #1
From: David Brownell <david-b@pacbell.net>
Date: Fri, 16 Jan 2009 23:19:44 -0800

> Improve usbnet's devdbg to always type-check diagnostic arguments,
> like dev_dbg (device.h).  This makes no change to the resulting size of
> usbnet modules.
> 
> Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 20, 2009, 1:57 a.m. UTC | #2
From: David Miller <davem@davemloft.net>
Date: Mon, 19 Jan 2009 17:12:00 -0800 (PST)

> From: David Brownell <david-b@pacbell.net>
> Date: Fri, 16 Jan 2009 23:19:44 -0800
> 
> > Improve usbnet's devdbg to always type-check diagnostic arguments,
> > like dev_dbg (device.h).  This makes no change to the resulting size of
> > usbnet modules.
> > 
> > Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
> > Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
> 
> Applied, thanks.

I have to back this out, it breaks the build:

drivers/net/wireless/rndis_wlan.c: In function 'rndis_translate_scan':
drivers/net/wireless/rndis_wlan.c:1664: error: 'usbdev' undeclared (first use in this function)
drivers/net/wireless/rndis_wlan.c:1664: error: (Each undeclared identifier is reported only once
drivers/net/wireless/rndis_wlan.c:1664: error: for each function it appears in.)
make[3]: *** [drivers/net/wireless/rndis_wlan.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [drivers/net/wireless] Error 2
make[2]: *** Waiting for unfinished jobs....

I bet there are other similar gremlins like this in the tree.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Brownell Jan. 20, 2009, 2:04 a.m. UTC | #3
On Monday 19 January 2009, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Mon, 19 Jan 2009 17:12:00 -0800 (PST)
> 
> > From: David Brownell <david-b@pacbell.net>
> > Date: Fri, 16 Jan 2009 23:19:44 -0800
> > 
> > > Improve usbnet's devdbg to always type-check diagnostic arguments,
> > > like dev_dbg (device.h).  This makes no change to the resulting size of
> > > usbnet modules.
> > > 
> > > Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
> > > Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
> > 
> > Applied, thanks.
> 
> I have to back this out, it breaks the build:
> 
> drivers/net/wireless/rndis_wlan.c: In function 'rndis_translate_scan':
> drivers/net/wireless/rndis_wlan.c:1664: error: 'usbdev' undeclared (first use in this function)
> drivers/net/wireless/rndis_wlan.c:1664: error: (Each undeclared identifier is reported only once
> drivers/net/wireless/rndis_wlan.c:1664: error: for each function it appears in.)
> make[3]: *** [drivers/net/wireless/rndis_wlan.o] Error 1
> make[3]: *** Waiting for unfinished jobs....
> make[2]: *** [drivers/net/wireless] Error 2
> make[2]: *** Waiting for unfinished jobs....
> 
> I bet there are other similar gremlins like this in the tree.

Maybe, but that's after all part of why we want this kind
of patch merged ... after the first gremlines are fixed!

In this case I'll guess this is the root cause of the bug:

#ifdef DEBUG
        struct usbnet *usbdev = netdev_priv(dev);
#endif

 
CC'd someone more involved in rndis_wlan than me ...

- Dave



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 20, 2009, 4:08 a.m. UTC | #4
From: David Brownell <david-b@pacbell.net>
Date: Mon, 19 Jan 2009 18:04:08 -0800

> Maybe, but that's after all part of why we want this kind
> of patch merged ... after the first gremlines are fixed!

When you submit a change like this that can have
potential warning and build failure effects across
the entire tree, the onus is on you to do an
allmodconfig sanity check build or similar and
add any necessary fixes to your change.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Brownell Jan. 20, 2009, 5:11 a.m. UTC | #5
On Monday 19 January 2009, David Miller wrote:
> > Maybe, but that's after all part of why we want this kind
> > of patch merged ... after the first gremlines are fixed!
> 
> When you submit a change like this that can have
> potential warning and build failure effects across
> the entire tree, the onus is on you to do an
> allmodconfig sanity check build or similar and
> add any necessary fixes to your change.

It's actually Steve's patch ... Steve?


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Glendinning Jan. 20, 2009, 10:56 a.m. UTC | #6
David Brownell <david-b@pacbell.net> wrote on 20/01/2009 05:11:48:
> On Monday 19 January 2009, David Miller wrote:
> > > Maybe, but that's after all part of why we want this kind
> > > of patch merged ... after the first gremlines are fixed!
> > 
> > When you submit a change like this that can have
> > potential warning and build failure effects across
> > the entire tree, the onus is on you to do an
> > allmodconfig sanity check build or similar and
> > add any necessary fixes to your change.
> 
> It's actually Steve's patch ... Steve?
> 

Sorry, my bad - I tested compilation of usbnet drivers in
drivers/net/usb but missed this wireless usbnet driver hiding
in drivers/net/wireless.  allmodconfig was what i was looking
for, thanks David!

I've fixed this compilation breakage now, updated patchset to
follow.

Steve
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 20, 2009, 5:19 p.m. UTC | #7
From: Steve.Glendinning@smsc.com
Date: Tue, 20 Jan 2009 10:56:09 +0000

> I've fixed this compilation breakage now, updated patchset to
> follow.

But you added a new warning for the non-DEBUG case during the
intermediate steps between the patches.

Please respin this all into a single patch in order to make the
transition cleanly, for all cases.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -197,7 +197,9 @@  extern int usbnet_nway_reset(struct net_
 #define devdbg(usbnet, fmt, arg...) \
 	printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
 #else
-#define devdbg(usbnet, fmt, arg...) do {} while(0)
+#define devdbg(usbnet, fmt, arg...) \
+	({ if (0) printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , \
+		## arg); 0; })
 #endif
 
 #define deverr(usbnet, fmt, arg...) \