Commit 36925e52 authored by Joe Perches's avatar Joe Perches Committed by Kalle Valo

mwifiex: Make mwifiex_dbg a function, reduce object size

The mwifiex_dbg macro has two tests that could be consolidated
into a function reducing overall object size ~10KB (~4%).

So convert the macro into a function.

$ size drivers/net/wireless/mwifiex/built-in.o* (x86-64 defconfig)
   text	   data	    bss	    dec	    hex	filename
 233102	   8628	   4809	 246539	  3c30b	drivers/net/wireless/mwifiex/built-in.o.new
 243949	   8628	   4809	 257386	  3ed6a	drivers/net/wireless/mwifiex/built-in.o.old
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 07fe2e38
...@@ -1447,6 +1447,26 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) ...@@ -1447,6 +1447,26 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
} }
EXPORT_SYMBOL_GPL(mwifiex_remove_card); EXPORT_SYMBOL_GPL(mwifiex_remove_card);
void _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask,
const char *fmt, ...)
{
struct va_format vaf;
va_list args;
if (!adapter->dev || !(adapter->debug_mask & mask))
return;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
dev_info(adapter->dev, "%pV", &vaf);
va_end(args);
}
EXPORT_SYMBOL_GPL(_mwifiex_dbg);
/* /*
* This function initializes the module. * This function initializes the module.
* *
......
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
extern const char driver_version[]; extern const char driver_version[];
struct mwifiex_adapter;
struct mwifiex_private;
enum { enum {
MWIFIEX_ASYNC_CMD, MWIFIEX_ASYNC_CMD,
MWIFIEX_SYNC_CMD MWIFIEX_SYNC_CMD
...@@ -180,12 +183,11 @@ enum MWIFIEX_DEBUG_LEVEL { ...@@ -180,12 +183,11 @@ enum MWIFIEX_DEBUG_LEVEL {
MWIFIEX_DBG_FATAL | \ MWIFIEX_DBG_FATAL | \
MWIFIEX_DBG_ERROR) MWIFIEX_DBG_ERROR)
#define mwifiex_dbg(adapter, dbg_mask, fmt, args...) \ __printf(3, 4)
do { \ void _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask,
if ((adapter)->debug_mask & MWIFIEX_DBG_##dbg_mask) \ const char *fmt, ...);
if ((adapter)->dev) \ #define mwifiex_dbg(adapter, mask, fmt, ...) \
dev_info((adapter)->dev, fmt, ## args); \ _mwifiex_dbg(adapter, MWIFIEX_DBG_##mask, fmt, ##__VA_ARGS__)
} while (0)
#define DEBUG_DUMP_DATA_MAX_LEN 128 #define DEBUG_DUMP_DATA_MAX_LEN 128
#define mwifiex_dbg_dump(adapter, dbg_mask, str, buf, len) \ #define mwifiex_dbg_dump(adapter, dbg_mask, str, buf, len) \
...@@ -506,9 +508,6 @@ enum mwifiex_iface_work_flags { ...@@ -506,9 +508,6 @@ enum mwifiex_iface_work_flags {
MWIFIEX_IFACE_WORK_CARD_RESET, MWIFIEX_IFACE_WORK_CARD_RESET,
}; };
struct mwifiex_adapter;
struct mwifiex_private;
struct mwifiex_private { struct mwifiex_private {
struct mwifiex_adapter *adapter; struct mwifiex_adapter *adapter;
u8 bss_type; u8 bss_type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment