diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2015-09-23 08:18:36 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-09-29 09:56:49 -0400 |
commit | 416eb9fc29469f036c85b412edf89774d6b34b0f (patch) | |
tree | 028a77eb67bc5172ecd90eb17cd832d300486a2c | |
parent | 6db96838971eb4c8ae6285795188f391e97d47c3 (diff) |
mac80211: Deinline drv_get/set/reset_tsf()
With this .config: http://busybox.net/~vda/kernel_config_ALLYES_Os,
after deinlining these functions have sizes and callsite counts
as follows:
drv_get_tsf: 634 bytes, 6 calls
drv_set_tsf: 626 bytes, 2 calls
drv_reset_tsf: 617 bytes, 2 calls
Total size reduction is about 4.2 kbytes.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: Johannes Berg <johannes.berg@intel.com>
CC: John Linville <linville@tuxdriver.com>
CC: Michal Kazior <michal.kazior@tieto.com>
CC: linux-wireless@vger.kernel.org
CC: linux-kernel@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/driver-ops.c | 46 | ||||
-rw-r--r-- | net/mac80211/driver-ops.h | 52 |
2 files changed, 53 insertions, 45 deletions
diff --git a/net/mac80211/driver-ops.c b/net/mac80211/driver-ops.c index e1bb9e04e5be..a1d54318f16c 100644 --- a/net/mac80211/driver-ops.c +++ b/net/mac80211/driver-ops.c | |||
@@ -139,6 +139,52 @@ int drv_conf_tx(struct ieee80211_local *local, | |||
139 | return ret; | 139 | return ret; |
140 | } | 140 | } |
141 | 141 | ||
142 | u64 drv_get_tsf(struct ieee80211_local *local, | ||
143 | struct ieee80211_sub_if_data *sdata) | ||
144 | { | ||
145 | u64 ret = -1ULL; | ||
146 | |||
147 | might_sleep(); | ||
148 | |||
149 | if (!check_sdata_in_driver(sdata)) | ||
150 | return ret; | ||
151 | |||
152 | trace_drv_get_tsf(local, sdata); | ||
153 | if (local->ops->get_tsf) | ||
154 | ret = local->ops->get_tsf(&local->hw, &sdata->vif); | ||
155 | trace_drv_return_u64(local, ret); | ||
156 | return ret; | ||
157 | } | ||
158 | |||
159 | void drv_set_tsf(struct ieee80211_local *local, | ||
160 | struct ieee80211_sub_if_data *sdata, | ||
161 | u64 tsf) | ||
162 | { | ||
163 | might_sleep(); | ||
164 | |||
165 | if (!check_sdata_in_driver(sdata)) | ||
166 | return; | ||
167 | |||
168 | trace_drv_set_tsf(local, sdata, tsf); | ||
169 | if (local->ops->set_tsf) | ||
170 | local->ops->set_tsf(&local->hw, &sdata->vif, tsf); | ||
171 | trace_drv_return_void(local); | ||
172 | } | ||
173 | |||
174 | void drv_reset_tsf(struct ieee80211_local *local, | ||
175 | struct ieee80211_sub_if_data *sdata) | ||
176 | { | ||
177 | might_sleep(); | ||
178 | |||
179 | if (!check_sdata_in_driver(sdata)) | ||
180 | return; | ||
181 | |||
182 | trace_drv_reset_tsf(local, sdata); | ||
183 | if (local->ops->reset_tsf) | ||
184 | local->ops->reset_tsf(&local->hw, &sdata->vif); | ||
185 | trace_drv_return_void(local); | ||
186 | } | ||
187 | |||
142 | int drv_switch_vif_chanctx(struct ieee80211_local *local, | 188 | int drv_switch_vif_chanctx(struct ieee80211_local *local, |
143 | struct ieee80211_vif_chanctx_switch *vifs, | 189 | struct ieee80211_vif_chanctx_switch *vifs, |
144 | int n_vifs, enum ieee80211_chanctx_switch_mode mode) | 190 | int n_vifs, enum ieee80211_chanctx_switch_mode mode) |
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 6411c3b9fe38..30987099eb8f 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -590,51 +590,13 @@ int drv_conf_tx(struct ieee80211_local *local, | |||
590 | struct ieee80211_sub_if_data *sdata, u16 ac, | 590 | struct ieee80211_sub_if_data *sdata, u16 ac, |
591 | const struct ieee80211_tx_queue_params *params); | 591 | const struct ieee80211_tx_queue_params *params); |
592 | 592 | ||
593 | static inline u64 drv_get_tsf(struct ieee80211_local *local, | 593 | u64 drv_get_tsf(struct ieee80211_local *local, |
594 | struct ieee80211_sub_if_data *sdata) | 594 | struct ieee80211_sub_if_data *sdata); |
595 | { | 595 | void drv_set_tsf(struct ieee80211_local *local, |
596 | u64 ret = -1ULL; | 596 | struct ieee80211_sub_if_data *sdata, |
597 | 597 | u64 tsf); | |
598 | might_sleep(); | 598 | void drv_reset_tsf(struct ieee80211_local *local, |
599 | 599 | struct ieee80211_sub_if_data *sdata); | |
600 | if (!check_sdata_in_driver(sdata)) | ||
601 | return ret; | ||
602 | |||
603 | trace_drv_get_tsf(local, sdata); | ||
604 | if (local->ops->get_tsf) | ||
605 | ret = local->ops->get_tsf(&local->hw, &sdata->vif); | ||
606 | trace_drv_return_u64(local, ret); | ||
607 | return ret; | ||
608 | } | ||
609 | |||
610 | static inline void drv_set_tsf(struct ieee80211_local *local, | ||
611 | struct ieee80211_sub_if_data *sdata, | ||
612 | u64 tsf) | ||
613 | { | ||
614 | might_sleep(); | ||
615 | |||
616 | if (!check_sdata_in_driver(sdata)) | ||
617 | return; | ||
618 | |||
619 | trace_drv_set_tsf(local, sdata, tsf); | ||
620 | if (local->ops->set_tsf) | ||
621 | local->ops->set_tsf(&local->hw, &sdata->vif, tsf); | ||
622 | trace_drv_return_void(local); | ||
623 | } | ||
624 | |||
625 | static inline void drv_reset_tsf(struct ieee80211_local *local, | ||
626 | struct ieee80211_sub_if_data *sdata) | ||
627 | { | ||
628 | might_sleep(); | ||
629 | |||
630 | if (!check_sdata_in_driver(sdata)) | ||
631 | return; | ||
632 | |||
633 | trace_drv_reset_tsf(local, sdata); | ||
634 | if (local->ops->reset_tsf) | ||
635 | local->ops->reset_tsf(&local->hw, &sdata->vif); | ||
636 | trace_drv_return_void(local); | ||
637 | } | ||
638 | 600 | ||
639 | static inline int drv_tx_last_beacon(struct ieee80211_local *local) | 601 | static inline int drv_tx_last_beacon(struct ieee80211_local *local) |
640 | { | 602 | { |