diff options
author | Joe Perches <joe@perches.com> | 2011-08-26 04:56:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-30 15:38:52 -0400 |
commit | 29e76245d46ff530bb2b0311e9fc823fc07b1147 (patch) | |
tree | 616e40295d0ca6b87e51334f32f4338cac3eb30a /drivers/net/wireless | |
parent | 7b8112d6db0cc67dd2a722ca5bf707768890ac9d (diff) |
ath: Make ath_printk void not int and remove unused struct ath_common *
Changing the return type and removing the unused argument from
ath_printk reduces code size.
Add an __always_unused struct ath_common * to the macros
that call ath_printk to avoid unused variable warnings.
$ size drivers/net/wireless/ath/built-in.o*
text data bss dec hex filename
1159859 16235 212000 1388094 152e3e drivers/net/wireless/ath/built-in.o.new
1164175 16235 212032 1392442 153f3a drivers/net/wireless/ath/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath.h | 27 | ||||
-rw-r--r-- | drivers/net/wireless/ath/main.c | 8 |
2 files changed, 18 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index a3f8505c712b..9891fb605a01 100644 --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h | |||
@@ -178,24 +178,29 @@ bool ath_hw_keyreset(struct ath_common *common, u16 entry); | |||
178 | void ath_hw_cycle_counters_update(struct ath_common *common); | 178 | void ath_hw_cycle_counters_update(struct ath_common *common); |
179 | int32_t ath_hw_get_listen_time(struct ath_common *common); | 179 | int32_t ath_hw_get_listen_time(struct ath_common *common); |
180 | 180 | ||
181 | extern __attribute__((format (printf, 3, 4))) | 181 | extern __attribute__((format (printf, 2, 3))) |
182 | int ath_printk(const char *level, struct ath_common *common, | 182 | void ath_printk(const char *level, const char *fmt, ...); |
183 | const char *fmt, ...); | 183 | |
184 | #define _ath_printk(level, common, fmt, ...) \ | ||
185 | do { \ | ||
186 | __always_unused struct ath_common *unused = common; \ | ||
187 | ath_printk(level, fmt, ##__VA_ARGS__); \ | ||
188 | } while (0) | ||
184 | 189 | ||
185 | #define ath_emerg(common, fmt, ...) \ | 190 | #define ath_emerg(common, fmt, ...) \ |
186 | ath_printk(KERN_EMERG, common, fmt, ##__VA_ARGS__) | 191 | _ath_printk(KERN_EMERG, common, fmt, ##__VA_ARGS__) |
187 | #define ath_alert(common, fmt, ...) \ | 192 | #define ath_alert(common, fmt, ...) \ |
188 | ath_printk(KERN_ALERT, common, fmt, ##__VA_ARGS__) | 193 | _ath_printk(KERN_ALERT, common, fmt, ##__VA_ARGS__) |
189 | #define ath_crit(common, fmt, ...) \ | 194 | #define ath_crit(common, fmt, ...) \ |
190 | ath_printk(KERN_CRIT, common, fmt, ##__VA_ARGS__) | 195 | _ath_printk(KERN_CRIT, common, fmt, ##__VA_ARGS__) |
191 | #define ath_err(common, fmt, ...) \ | 196 | #define ath_err(common, fmt, ...) \ |
192 | ath_printk(KERN_ERR, common, fmt, ##__VA_ARGS__) | 197 | _ath_printk(KERN_ERR, common, fmt, ##__VA_ARGS__) |
193 | #define ath_warn(common, fmt, ...) \ | 198 | #define ath_warn(common, fmt, ...) \ |
194 | ath_printk(KERN_WARNING, common, fmt, ##__VA_ARGS__) | 199 | _ath_printk(KERN_WARNING, common, fmt, ##__VA_ARGS__) |
195 | #define ath_notice(common, fmt, ...) \ | 200 | #define ath_notice(common, fmt, ...) \ |
196 | ath_printk(KERN_NOTICE, common, fmt, ##__VA_ARGS__) | 201 | _ath_printk(KERN_NOTICE, common, fmt, ##__VA_ARGS__) |
197 | #define ath_info(common, fmt, ...) \ | 202 | #define ath_info(common, fmt, ...) \ |
198 | ath_printk(KERN_INFO, common, fmt, ##__VA_ARGS__) | 203 | _ath_printk(KERN_INFO, common, fmt, ##__VA_ARGS__) |
199 | 204 | ||
200 | /** | 205 | /** |
201 | * enum ath_debug_level - atheros wireless debug level | 206 | * enum ath_debug_level - atheros wireless debug level |
@@ -250,7 +255,7 @@ enum ATH_DEBUG { | |||
250 | #define ath_dbg(common, dbg_mask, fmt, ...) \ | 255 | #define ath_dbg(common, dbg_mask, fmt, ...) \ |
251 | do { \ | 256 | do { \ |
252 | if ((common)->debug_mask & dbg_mask) \ | 257 | if ((common)->debug_mask & dbg_mask) \ |
253 | ath_printk(KERN_DEBUG, common, fmt, ##__VA_ARGS__); \ | 258 | _ath_printk(KERN_DEBUG, common, fmt, ##__VA_ARGS__); \ |
254 | } while (0) | 259 | } while (0) |
255 | 260 | ||
256 | #define ATH_DBG_WARN(foo, arg...) WARN(foo, arg) | 261 | #define ATH_DBG_WARN(foo, arg...) WARN(foo, arg) |
diff --git a/drivers/net/wireless/ath/main.c b/drivers/net/wireless/ath/main.c index c325202fdc5f..d9218fe02036 100644 --- a/drivers/net/wireless/ath/main.c +++ b/drivers/net/wireless/ath/main.c | |||
@@ -57,22 +57,18 @@ struct sk_buff *ath_rxbuf_alloc(struct ath_common *common, | |||
57 | } | 57 | } |
58 | EXPORT_SYMBOL(ath_rxbuf_alloc); | 58 | EXPORT_SYMBOL(ath_rxbuf_alloc); |
59 | 59 | ||
60 | int ath_printk(const char *level, struct ath_common *common, | 60 | void ath_printk(const char *level, const char *fmt, ...) |
61 | const char *fmt, ...) | ||
62 | { | 61 | { |
63 | struct va_format vaf; | 62 | struct va_format vaf; |
64 | va_list args; | 63 | va_list args; |
65 | int rtn; | ||
66 | 64 | ||
67 | va_start(args, fmt); | 65 | va_start(args, fmt); |
68 | 66 | ||
69 | vaf.fmt = fmt; | 67 | vaf.fmt = fmt; |
70 | vaf.va = &args; | 68 | vaf.va = &args; |
71 | 69 | ||
72 | rtn = printk("%sath: %pV", level, &vaf); | 70 | printk("%sath: %pV", level, &vaf); |
73 | 71 | ||
74 | va_end(args); | 72 | va_end(args); |
75 | |||
76 | return rtn; | ||
77 | } | 73 | } |
78 | EXPORT_SYMBOL(ath_printk); | 74 | EXPORT_SYMBOL(ath_printk); |