diff options
| author | Joe Perches <joe@perches.com> | 2011-11-17 20:46:15 -0500 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2011-11-21 16:20:48 -0500 |
| commit | 1e7aecc26b95efb9d9bdba1ff5c33c99ca34d4ad (patch) | |
| tree | 96582cf4a9b32af23c4fb5aada49a600b3b6249b /drivers | |
| parent | 1ffeb2a3e943299a2ca954b8d10c208c853c1960 (diff) | |
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: Joe Perches <joe@perches.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debug.h | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h index 40ef97bac1aa..44a7bdd7ccfd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debug.h +++ b/drivers/net/wireless/iwlwifi/iwl-debug.h | |||
| @@ -47,20 +47,21 @@ do { \ | |||
| 47 | } while (0) | 47 | } while (0) |
| 48 | 48 | ||
| 49 | #ifdef CONFIG_IWLWIFI_DEBUG | 49 | #ifdef CONFIG_IWLWIFI_DEBUG |
| 50 | #define IWL_DEBUG(m, level, fmt, args...) \ | 50 | #define IWL_DEBUG(m, level, fmt, ...) \ |
| 51 | do { \ | 51 | do { \ |
| 52 | if (iwl_get_debug_level((m)->shrd) & (level)) \ | 52 | if (iwl_get_debug_level((m)->shrd) & (level)) \ |
| 53 | dev_printk(KERN_ERR, bus(m)->dev, \ | 53 | dev_err(bus(m)->dev, "%c %s " fmt, \ |
| 54 | "%c %s " fmt, in_interrupt() ? 'I' : 'U', \ | 54 | in_interrupt() ? 'I' : 'U', __func__, \ |
| 55 | __func__ , ## args); \ | 55 | ##__VA_ARGS__); \ |
| 56 | } while (0) | 56 | } while (0) |
| 57 | 57 | ||
| 58 | #define IWL_DEBUG_LIMIT(m, level, fmt, args...) \ | 58 | #define IWL_DEBUG_LIMIT(m, level, fmt, ...) \ |
| 59 | do { \ | 59 | do { \ |
| 60 | if (iwl_get_debug_level((m)->shrd) & (level) && net_ratelimit())\ | 60 | if (iwl_get_debug_level((m)->shrd) & (level) && \ |
| 61 | dev_printk(KERN_ERR, bus(m)->dev, \ | 61 | net_ratelimit()) \ |
| 62 | "%c %s " fmt, in_interrupt() ? 'I' : 'U', \ | 62 | dev_err(bus(m)->dev, "%c %s " fmt, \ |
| 63 | __func__ , ## args); \ | 63 | in_interrupt() ? 'I' : 'U', __func__, \ |
| 64 | ##__VA_ARGS__); \ | ||
| 64 | } while (0) | 65 | } while (0) |
| 65 | 66 | ||
| 66 | #define iwl_print_hex_dump(m, level, p, len) \ | 67 | #define iwl_print_hex_dump(m, level, p, len) \ |
| @@ -70,14 +71,18 @@ do { \ | |||
| 70 | DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ | 71 | DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ |
| 71 | } while (0) | 72 | } while (0) |
| 72 | 73 | ||
| 73 | #define IWL_DEBUG_QUIET_RFKILL(p, fmt, args...) \ | 74 | #define IWL_DEBUG_QUIET_RFKILL(p, fmt, ...) \ |
| 74 | do { \ | 75 | do { \ |
| 75 | if (!iwl_is_rfkill(p->shrd)) \ | 76 | if (!iwl_is_rfkill(p->shrd)) \ |
| 76 | dev_printk(KERN_ERR, bus(p)->dev, "%c %s " fmt, \ | 77 | dev_err(bus(p)->dev, "%s%c %s " fmt, \ |
| 77 | (in_interrupt() ? 'I' : 'U'), __func__ , ##args); \ | 78 | "", \ |
| 78 | else if (iwl_get_debug_level(p->shrd) & IWL_DL_RADIO) \ | 79 | in_interrupt() ? 'I' : 'U', __func__, \ |
| 79 | dev_printk(KERN_ERR, bus(p)->dev, "(RFKILL) %c %s " fmt, \ | 80 | ##__VA_ARGS__); \ |
| 80 | (in_interrupt() ? 'I' : 'U'), __func__ , ##args); \ | 81 | else if (iwl_get_debug_level(p->shrd) & IWL_DL_RADIO) \ |
| 82 | dev_err(bus(p)->dev, "%s%c %s " fmt, \ | ||
| 83 | "(RFKILL) ", \ | ||
| 84 | in_interrupt() ? 'I' : 'U', __func__, \ | ||
| 85 | ##__VA_ARGS__); \ | ||
| 81 | } while (0) | 86 | } while (0) |
| 82 | 87 | ||
| 83 | #else | 88 | #else |
