diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2015-07-15 08:56:05 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-07-17 09:48:50 -0400 |
commit | 727da60be91c9fd59f1b084ca537b5123ab97744 (patch) | |
tree | bed8b51c65e6684f33961c102ba83c8019d8a558 | |
parent | 0e0060fcfb3d0f5a53ef43e7b6a50227b934ab7c (diff) |
mac80211: deinline drv_sta_state
With this .config: http://busybox.net/~vda/kernel_config,
after deinlining the function size is 3132 bytes and there are
7 callsites.
Total size reduction: about 20 kbytes.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: John Linville <linville@tuxdriver.com>
CC: Michal Kazior <michal.kazior@tieto.com>
Cc: Johannes Berg <johannes.berg@intel.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
CC: linux-kernel@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/Makefile | 1 | ||||
-rw-r--r-- | net/mac80211/driver-ops.c | 41 | ||||
-rw-r--r-- | net/mac80211/driver-ops.h | 29 |
3 files changed, 44 insertions, 27 deletions
diff --git a/net/mac80211/Makefile b/net/mac80211/Makefile index 3275f01881be..783e891b7525 100644 --- a/net/mac80211/Makefile +++ b/net/mac80211/Makefile | |||
@@ -3,6 +3,7 @@ obj-$(CONFIG_MAC80211) += mac80211.o | |||
3 | # mac80211 objects | 3 | # mac80211 objects |
4 | mac80211-y := \ | 4 | mac80211-y := \ |
5 | main.o status.o \ | 5 | main.o status.o \ |
6 | driver-ops.o \ | ||
6 | sta_info.o \ | 7 | sta_info.o \ |
7 | wep.o \ | 8 | wep.o \ |
8 | wpa.o \ | 9 | wpa.o \ |
diff --git a/net/mac80211/driver-ops.c b/net/mac80211/driver-ops.c new file mode 100644 index 000000000000..267c3b1ca047 --- /dev/null +++ b/net/mac80211/driver-ops.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License version 2 as | ||
4 | * published by the Free Software Foundation. | ||
5 | */ | ||
6 | #include <net/mac80211.h> | ||
7 | #include "ieee80211_i.h" | ||
8 | #include "trace.h" | ||
9 | #include "driver-ops.h" | ||
10 | |||
11 | __must_check | ||
12 | int drv_sta_state(struct ieee80211_local *local, | ||
13 | struct ieee80211_sub_if_data *sdata, | ||
14 | struct sta_info *sta, | ||
15 | enum ieee80211_sta_state old_state, | ||
16 | enum ieee80211_sta_state new_state) | ||
17 | { | ||
18 | int ret = 0; | ||
19 | |||
20 | might_sleep(); | ||
21 | |||
22 | sdata = get_bss_sdata(sdata); | ||
23 | if (!check_sdata_in_driver(sdata)) | ||
24 | return -EIO; | ||
25 | |||
26 | trace_drv_sta_state(local, sdata, &sta->sta, old_state, new_state); | ||
27 | if (local->ops->sta_state) { | ||
28 | ret = local->ops->sta_state(&local->hw, &sdata->vif, &sta->sta, | ||
29 | old_state, new_state); | ||
30 | } else if (old_state == IEEE80211_STA_AUTH && | ||
31 | new_state == IEEE80211_STA_ASSOC) { | ||
32 | ret = drv_sta_add(local, sdata, &sta->sta); | ||
33 | if (ret == 0) | ||
34 | sta->uploaded = true; | ||
35 | } else if (old_state == IEEE80211_STA_ASSOC && | ||
36 | new_state == IEEE80211_STA_AUTH) { | ||
37 | drv_sta_remove(local, sdata, &sta->sta); | ||
38 | } | ||
39 | trace_drv_return_int(local, ret); | ||
40 | return ret; | ||
41 | } | ||
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 32a2e707e222..02d91332d7dd 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -573,37 +573,12 @@ static inline void drv_sta_pre_rcu_remove(struct ieee80211_local *local, | |||
573 | trace_drv_return_void(local); | 573 | trace_drv_return_void(local); |
574 | } | 574 | } |
575 | 575 | ||
576 | static inline __must_check | 576 | __must_check |
577 | int drv_sta_state(struct ieee80211_local *local, | 577 | int drv_sta_state(struct ieee80211_local *local, |
578 | struct ieee80211_sub_if_data *sdata, | 578 | struct ieee80211_sub_if_data *sdata, |
579 | struct sta_info *sta, | 579 | struct sta_info *sta, |
580 | enum ieee80211_sta_state old_state, | 580 | enum ieee80211_sta_state old_state, |
581 | enum ieee80211_sta_state new_state) | 581 | enum ieee80211_sta_state new_state); |
582 | { | ||
583 | int ret = 0; | ||
584 | |||
585 | might_sleep(); | ||
586 | |||
587 | sdata = get_bss_sdata(sdata); | ||
588 | if (!check_sdata_in_driver(sdata)) | ||
589 | return -EIO; | ||
590 | |||
591 | trace_drv_sta_state(local, sdata, &sta->sta, old_state, new_state); | ||
592 | if (local->ops->sta_state) { | ||
593 | ret = local->ops->sta_state(&local->hw, &sdata->vif, &sta->sta, | ||
594 | old_state, new_state); | ||
595 | } else if (old_state == IEEE80211_STA_AUTH && | ||
596 | new_state == IEEE80211_STA_ASSOC) { | ||
597 | ret = drv_sta_add(local, sdata, &sta->sta); | ||
598 | if (ret == 0) | ||
599 | sta->uploaded = true; | ||
600 | } else if (old_state == IEEE80211_STA_ASSOC && | ||
601 | new_state == IEEE80211_STA_AUTH) { | ||
602 | drv_sta_remove(local, sdata, &sta->sta); | ||
603 | } | ||
604 | trace_drv_return_int(local, ret); | ||
605 | return ret; | ||
606 | } | ||
607 | 582 | ||
608 | static inline void drv_sta_rc_update(struct ieee80211_local *local, | 583 | static inline void drv_sta_rc_update(struct ieee80211_local *local, |
609 | struct ieee80211_sub_if_data *sdata, | 584 | struct ieee80211_sub_if_data *sdata, |