Commit 1e7aecc2 authored by Joe Perches's avatar Joe Perches Committed by John W. Linville

iwl-debug: Shrink object by using dev_err and deduplicating formats

Using dev_err instead of dev_printk(KERN_ERR uses fewer
arguments and is a bit smaller.

Deduplicating formats used by IWL_DEBUG_QUIET_RFKILL also
makes the object a bit smaller.

Neatened the macros, used ##__VA_ARGS__.

$ size drivers/net/wireless/iwlwifi/built-in.o*
   text	   data	    bss	    dec	    hex	filename
 462652	   8646	  92576	 563874	  89aa2	drivers/net/wireless/iwlwifi/built-in.o.new
 467557	   8646	  92592	 568795	  8addb	drivers/net/wireless/iwlwifi/built-in.o.old
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1ffeb2a3
...@@ -47,20 +47,21 @@ do { \ ...@@ -47,20 +47,21 @@ do { \
} while (0) } while (0)
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
#define IWL_DEBUG(m, level, fmt, args...) \ #define IWL_DEBUG(m, level, fmt, ...) \
do { \ do { \
if (iwl_get_debug_level((m)->shrd) & (level)) \ if (iwl_get_debug_level((m)->shrd) & (level)) \
dev_printk(KERN_ERR, bus(m)->dev, \ dev_err(bus(m)->dev, "%c %s " fmt, \
"%c %s " fmt, in_interrupt() ? 'I' : 'U', \ in_interrupt() ? 'I' : 'U', __func__, \
__func__ , ## args); \ ##__VA_ARGS__); \
} while (0) } while (0)
#define IWL_DEBUG_LIMIT(m, level, fmt, args...) \ #define IWL_DEBUG_LIMIT(m, level, fmt, ...) \
do { \ do { \
if (iwl_get_debug_level((m)->shrd) & (level) && net_ratelimit())\ if (iwl_get_debug_level((m)->shrd) & (level) && \
dev_printk(KERN_ERR, bus(m)->dev, \ net_ratelimit()) \
"%c %s " fmt, in_interrupt() ? 'I' : 'U', \ dev_err(bus(m)->dev, "%c %s " fmt, \
__func__ , ## args); \ in_interrupt() ? 'I' : 'U', __func__, \
##__VA_ARGS__); \
} while (0) } while (0)
#define iwl_print_hex_dump(m, level, p, len) \ #define iwl_print_hex_dump(m, level, p, len) \
...@@ -70,14 +71,18 @@ do { \ ...@@ -70,14 +71,18 @@ do { \
DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
} while (0) } while (0)
#define IWL_DEBUG_QUIET_RFKILL(p, fmt, args...) \ #define IWL_DEBUG_QUIET_RFKILL(p, fmt, ...) \
do { \ do { \
if (!iwl_is_rfkill(p->shrd)) \ if (!iwl_is_rfkill(p->shrd)) \
dev_printk(KERN_ERR, bus(p)->dev, "%c %s " fmt, \ dev_err(bus(p)->dev, "%s%c %s " fmt, \
(in_interrupt() ? 'I' : 'U'), __func__ , ##args); \ "", \
in_interrupt() ? 'I' : 'U', __func__, \
##__VA_ARGS__); \
else if (iwl_get_debug_level(p->shrd) & IWL_DL_RADIO) \ else if (iwl_get_debug_level(p->shrd) & IWL_DL_RADIO) \
dev_printk(KERN_ERR, bus(p)->dev, "(RFKILL) %c %s " fmt, \ dev_err(bus(p)->dev, "%s%c %s " fmt, \
(in_interrupt() ? 'I' : 'U'), __func__ , ##args); \ "(RFKILL) ", \
in_interrupt() ? 'I' : 'U', __func__, \
##__VA_ARGS__); \
} while (0) } while (0)
#else #else
......
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