aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/base.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-03-18 17:30:53 -0700
committerJohn W. Linville <linville@tuxdriver.com>2012-04-10 14:52:14 -0400
commit227842d1176019512d24236f7fb894f0fadd30d1 (patch)
tree431ec48aaacfbfbe33083cde0d038ec21284bfba /drivers/net/wireless/ath/ath5k/base.c
parentath: Add and use pr_fmt, convert printks to pr_<level> (diff)
downloadlinux-dev-227842d1176019512d24236f7fb894f0fadd30d1.tar.xz
linux-dev-227842d1176019512d24236f7fb894f0fadd30d1.zip
ath5k: Introduce _ath5k_printk to reduce code/text
Macros can be converted to functions to reduce overall object size. Convert the ATH5K_PRINTK macro to use _ath5k_printk. Allyesconfig size is reduced ~10% $ size drivers/net/wireless/ath/ath5k/built-in.o* text data bss dec hex filename 211557 2032 40672 254261 3e135 drivers/net/wireless/ath/ath5k/built-in.o.new 235412 2032 47296 284740 45844 drivers/net/wireless/ath/ath5k/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/ath/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index a9c0503237e9..3007bba12d94 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -3040,3 +3040,23 @@ ath5k_set_beacon_filter(struct ieee80211_hw *hw, bool enable)
ath5k_hw_set_rx_filter(ah, rfilt);
ah->filter_flags = rfilt;
}
+
+void _ath5k_printk(const struct ath5k_hw *ah, const char *level,
+ const char *fmt, ...)
+{
+ struct va_format vaf;
+ va_list args;
+
+ va_start(args, fmt);
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+ if (ah && ah->hw)
+ printk("%s" pr_fmt("%s: %pV"),
+ level, wiphy_name(ah->hw->wiphy), &vaf);
+ else
+ printk("%s" pr_fmt("%pV"), level, &vaf);
+
+ va_end(args);
+}