提交 46868202 编写于 作者: H Holger Schurig 提交者: John W. Linville

[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: NHolger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 2be92196
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <net/iw_handler.h> #include <net/iw_handler.h>
#include "dev.h" #include "dev.h"
#include "decl.h" #include "decl.h"
#include "host.h" #include "host.h"
...@@ -15,7 +16,9 @@ static char *szStates[] = { ...@@ -15,7 +16,9 @@ static char *szStates[] = {
"Disconnected" "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) 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, ...@@ -61,16 +64,8 @@ static ssize_t libertas_getscantable(struct file *file, char __user *userbuf,
unsigned long addr = get_zeroed_page(GFP_KERNEL); unsigned long addr = get_zeroed_page(GFP_KERNEL);
char *buf = (char *)addr; char *buf = (char *)addr;
pos += snprintf(buf+pos, len-pos,
"---------------------------------------");
pos += snprintf(buf+pos, len-pos,
"---------------------------------------\n");
pos += snprintf(buf+pos, len-pos, pos += snprintf(buf+pos, len-pos,
"# | ch | ss | bssid | cap | TSF | Qual | SSID \n"); "# | 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) { while (numscansdone < priv->adapter->numinscantable) {
struct bss_descriptor *pbssinfo; struct bss_descriptor *pbssinfo;
...@@ -1772,11 +1767,16 @@ void libertas_debugfs_remove_one(wlan_private *priv) ...@@ -1772,11 +1767,16 @@ void libertas_debugfs_remove_one(wlan_private *priv)
debugfs_remove(priv->debugfs_dir); debugfs_remove(priv->debugfs_dir);
} }
/* debug entry */ /* debug entry */
#ifdef PROC_DEBUG
#define item_size(n) (FIELD_SIZEOF(wlan_adapter, n)) #define item_size(n) (FIELD_SIZEOF(wlan_adapter, n))
#define item_addr(n) (offsetof(wlan_adapter, n)) #define item_addr(n) (offsetof(wlan_adapter, n))
struct debug_data { struct debug_data {
char name[32]; char name[32];
u32 size; u32 size;
...@@ -1914,7 +1914,7 @@ static struct file_operations libertas_debug_fops = { ...@@ -1914,7 +1914,7 @@ static struct file_operations libertas_debug_fops = {
* @param dev pointer net_device * @param dev pointer net_device
* @return N/A * @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; int i;
...@@ -1928,4 +1928,5 @@ void libertas_debug_init(wlan_private * priv, struct net_device *dev) ...@@ -1928,4 +1928,5 @@ void libertas_debug_init(wlan_private * priv, struct net_device *dev)
priv->debugfs_dir, &items[0], priv->debugfs_dir, &items[0],
&libertas_debug_fops); &libertas_debug_fops);
} }
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册