aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-05-25 00:37:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-11 14:28:37 -0400
commit46868202b2dd22156460a220553a223f406f4f22 (patch)
tree20a1416dd5f42289c088c95f02ef0e4133cb208f /drivers/net
parent2be9219680e8abfa79da74e8d827ecf5c41be76d (diff)
[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 <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/libertas/debugfs.c21
1 files changed, 11 insertions, 10 deletions
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 @@
4#include <linux/delay.h> 4#include <linux/delay.h>
5#include <linux/mm.h> 5#include <linux/mm.h>
6#include <net/iw_handler.h> 6#include <net/iw_handler.h>
7
7#include "dev.h" 8#include "dev.h"
8#include "decl.h" 9#include "decl.h"
9#include "host.h" 10#include "host.h"
@@ -15,7 +16,9 @@ static char *szStates[] = {
15 "Disconnected" 16 "Disconnected"
16}; 17};
17 18
18void libertas_debug_init(wlan_private * priv, struct net_device *dev); 19#ifdef PROC_DEBUG
20static void libertas_debug_init(wlan_private * priv, struct net_device *dev);
21#endif
19 22
20static int open_file_generic(struct inode *inode, struct file *file) 23static int open_file_generic(struct inode *inode, struct file *file)
21{ 24{
@@ -62,15 +65,7 @@ static ssize_t libertas_getscantable(struct file *file, char __user *userbuf,
62 char *buf = (char *)addr; 65 char *buf = (char *)addr;
63 66
64 pos += snprintf(buf+pos, len-pos, 67 pos += snprintf(buf+pos, len-pos,
65 "---------------------------------------");
66 pos += snprintf(buf+pos, len-pos,
67 "---------------------------------------\n");
68 pos += snprintf(buf+pos, len-pos,
69 "# | ch | ss | bssid | cap | TSF | Qual | SSID \n"); 68 "# | ch | ss | bssid | cap | TSF | Qual | SSID \n");
70 pos += snprintf(buf+pos, len-pos,
71 "---------------------------------------");
72 pos += snprintf(buf+pos, len-pos,
73 "---------------------------------------\n");
74 69
75 while (numscansdone < priv->adapter->numinscantable) { 70 while (numscansdone < priv->adapter->numinscantable) {
76 struct bss_descriptor *pbssinfo; 71 struct bss_descriptor *pbssinfo;
@@ -1772,11 +1767,16 @@ void libertas_debugfs_remove_one(wlan_private *priv)
1772 debugfs_remove(priv->debugfs_dir); 1767 debugfs_remove(priv->debugfs_dir);
1773} 1768}
1774 1769
1770
1771
1775/* debug entry */ 1772/* debug entry */
1776 1773
1774#ifdef PROC_DEBUG
1775
1777#define item_size(n) (FIELD_SIZEOF(wlan_adapter, n)) 1776#define item_size(n) (FIELD_SIZEOF(wlan_adapter, n))
1778#define item_addr(n) (offsetof(wlan_adapter, n)) 1777#define item_addr(n) (offsetof(wlan_adapter, n))
1779 1778
1779
1780struct debug_data { 1780struct debug_data {
1781 char name[32]; 1781 char name[32];
1782 u32 size; 1782 u32 size;
@@ -1914,7 +1914,7 @@ static struct file_operations libertas_debug_fops = {
1914 * @param dev pointer net_device 1914 * @param dev pointer net_device
1915 * @return N/A 1915 * @return N/A
1916 */ 1916 */
1917void libertas_debug_init(wlan_private * priv, struct net_device *dev) 1917static void libertas_debug_init(wlan_private * priv, struct net_device *dev)
1918{ 1918{
1919 int i; 1919 int i;
1920 1920
@@ -1928,4 +1928,5 @@ void libertas_debug_init(wlan_private * priv, struct net_device *dev)
1928 priv->debugfs_dir, &items[0], 1928 priv->debugfs_dir, &items[0],
1929 &libertas_debug_fops); 1929 &libertas_debug_fops);
1930} 1930}
1931#endif
1931 1932