netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] rndis_wlan: allow devdbg arguments to be type-checked without DEBUG
@ 2009-01-20 13:07 Steve Glendinning
  2009-01-20 13:07 ` [PATCH 2/2] usbnet: allow type check of devdbg arguments in non-debug build Steve Glendinning
  2009-01-20 17:06 ` [PATCH 1/2] rndis_wlan: allow devdbg arguments to be type-checked without DEBUG David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Steve Glendinning @ 2009-01-20 13:07 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, David Brownell, Steve Glendinning

This patch removes an #ifdef DEBUG directive so devdbg statements can be
type-checked at compile time.  Type checking itself is introduced by
another patch in this series.

This introduces an unused variable warning which disappears with the
type-checking patch.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
---
 drivers/net/wireless/rndis_wlan.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 607ce9f..ed93ac4 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -1649,9 +1649,7 @@ static char *rndis_translate_scan(struct net_device *dev,
 				  char *end_buf,
 				  struct ndis_80211_bssid_ex *bssid)
 {
-#ifdef DEBUG
 	struct usbnet *usbdev = netdev_priv(dev);
-#endif
 	u8 *ie;
 	char *current_val;
 	int bssid_len, ie_len, i;
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] usbnet: allow type check of devdbg arguments in non-debug build
  2009-01-20 13:07 [PATCH 1/2] rndis_wlan: allow devdbg arguments to be type-checked without DEBUG Steve Glendinning
@ 2009-01-20 13:07 ` Steve Glendinning
  2009-01-20 17:06 ` [PATCH 1/2] rndis_wlan: allow devdbg arguments to be type-checked without DEBUG David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Steve Glendinning @ 2009-01-20 13:07 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, David Brownell, Steve Glendinning

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>
---
 include/linux/usb/usbnet.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index ba09fe8..7d38222 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -197,7 +197,9 @@ extern int usbnet_nway_reset(struct net_device *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...) \
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] rndis_wlan: allow devdbg arguments to be type-checked without DEBUG
  2009-01-20 13:07 [PATCH 1/2] rndis_wlan: allow devdbg arguments to be type-checked without DEBUG Steve Glendinning
  2009-01-20 13:07 ` [PATCH 2/2] usbnet: allow type check of devdbg arguments in non-debug build Steve Glendinning
@ 2009-01-20 17:06 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2009-01-20 17:06 UTC (permalink / raw)
  To: steve.glendinning; +Cc: netdev, david-b

From: Steve Glendinning <steve.glendinning@smsc.com>
Date: Tue, 20 Jan 2009 13:07:17 +0000

> This patch removes an #ifdef DEBUG directive so devdbg statements can be
> type-checked at compile time.  Type checking itself is introduced by
> another patch in this series.
> 
> This introduces an unused variable warning which disappears with the
> type-checking patch.
> 
> Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>

This adds a warning for the non-DEBUG build.  That's the whole reason
the ifdef is there.

Therefore you must do the devdbg() define change and this ifdef
removal in the same commit.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-20 17:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-20 13:07 [PATCH 1/2] rndis_wlan: allow devdbg arguments to be type-checked without DEBUG Steve Glendinning
2009-01-20 13:07 ` [PATCH 2/2] usbnet: allow type check of devdbg arguments in non-debug build Steve Glendinning
2009-01-20 17:06 ` [PATCH 1/2] rndis_wlan: allow devdbg arguments to be type-checked without DEBUG David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).