From 46868202b2dd22156460a220553a223f406f4f22 Mon Sep 17 00:00:00 2001 From: Holger Schurig Date: Fri, 25 May 2007 00:37:28 -0400 Subject: [PATCH] libertas: exclude non-used code when PROC_DEBUG is not set This reduces usb8xxx.ko by 951 bytes (text) and 256 bytes (data) when PROC_DEBUG isn't defined. Signed-off-by: Holger Schurig Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/debugfs.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'drivers/net') diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c index d77bec9f5d15..1d880e7973ba 100644 --- a/drivers/net/wireless/libertas/debugfs.c +++ b/drivers/net/wireless/libertas/debugfs.c @@ -4,6 +4,7 @@ #include #include #include + #include "dev.h" #include "decl.h" #include "host.h" @@ -15,7 +16,9 @@ static char *szStates[] = { "Disconnected" }; -void libertas_debug_init(wlan_private * priv, struct net_device *dev); +#ifdef PROC_DEBUG +static void libertas_debug_init(wlan_private * priv, struct net_device *dev); +#endif static int open_file_generic(struct inode *inode, struct file *file) { @@ -61,16 +64,8 @@ static ssize_t libertas_getscantable(struct file *file, char __user *userbuf, unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *)addr; - pos += snprintf(buf+pos, len-pos, - "---------------------------------------"); - pos += snprintf(buf+pos, len-pos, - "---------------------------------------\n"); pos += snprintf(buf+pos, len-pos, "# | ch | ss | bssid | cap | TSF | Qual | SSID \n"); - pos += snprintf(buf+pos, len-pos, - "---------------------------------------"); - pos += snprintf(buf+pos, len-pos, - "---------------------------------------\n"); while (numscansdone < priv->adapter->numinscantable) { struct bss_descriptor *pbssinfo; @@ -1772,11 +1767,16 @@ void libertas_debugfs_remove_one(wlan_private *priv) debugfs_remove(priv->debugfs_dir); } + + /* debug entry */ +#ifdef PROC_DEBUG + #define item_size(n) (FIELD_SIZEOF(wlan_adapter, n)) #define item_addr(n) (offsetof(wlan_adapter, n)) + struct debug_data { char name[32]; u32 size; @@ -1914,7 +1914,7 @@ static struct file_operations libertas_debug_fops = { * @param dev pointer net_device * @return N/A */ -void libertas_debug_init(wlan_private * priv, struct net_device *dev) +static void libertas_debug_init(wlan_private * priv, struct net_device *dev) { int i; @@ -1928,4 +1928,5 @@ void libertas_debug_init(wlan_private * priv, struct net_device *dev) priv->debugfs_dir, &items[0], &libertas_debug_fops); } +#endif -- cgit v1.2.3