1 From: Denys Vlasenko <dvlasenk@redhat.com>
2 Date: Wed, 15 Jul 2015 14:56:05 +0200
3 Subject: [PATCH] mac80211: Deinline drv_sta_state
5 With this .config: http://busybox.net/~vda/kernel_config,
6 after deinlining the function size is 3132 bytes and there are
9 Total size reduction: about 20 kbytes.
11 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
12 CC: John Linville <linville@tuxdriver.com>
13 CC: Michal Kazior <michal.kazior@tieto.com>
14 Cc: Johannes Berg <johannes.berg@intel.com>
15 Cc: linux-wireless@vger.kernel.org
16 Cc: netdev@vger.kernel.org
17 CC: linux-kernel@vger.kernel.org
19 create mode 100644 net/mac80211/driver-ops.c
21 --- a/net/mac80211/Makefile
22 +++ b/net/mac80211/Makefile
23 @@ -3,6 +3,7 @@ obj-$(CPTCFG_MAC80211) += mac80211.o
32 +++ b/net/mac80211/driver-ops.c
35 + * This program is free software; you can redistribute it and/or modify
36 + * it under the terms of the GNU General Public License version 2 as
37 + * published by the Free Software Foundation.
39 +#include <net/mac80211.h>
40 +#include "ieee80211_i.h"
42 +#include "driver-ops.h"
45 +int drv_sta_state(struct ieee80211_local *local,
46 + struct ieee80211_sub_if_data *sdata,
47 + struct sta_info *sta,
48 + enum ieee80211_sta_state old_state,
49 + enum ieee80211_sta_state new_state)
55 + sdata = get_bss_sdata(sdata);
56 + if (!check_sdata_in_driver(sdata))
59 + trace_drv_sta_state(local, sdata, &sta->sta, old_state, new_state);
60 + if (local->ops->sta_state) {
61 + ret = local->ops->sta_state(&local->hw, &sdata->vif, &sta->sta,
62 + old_state, new_state);
63 + } else if (old_state == IEEE80211_STA_AUTH &&
64 + new_state == IEEE80211_STA_ASSOC) {
65 + ret = drv_sta_add(local, sdata, &sta->sta);
67 + sta->uploaded = true;
68 + } else if (old_state == IEEE80211_STA_ASSOC &&
69 + new_state == IEEE80211_STA_AUTH) {
70 + drv_sta_remove(local, sdata, &sta->sta);
72 + trace_drv_return_int(local, ret);
75 --- a/net/mac80211/driver-ops.h
76 +++ b/net/mac80211/driver-ops.h
77 @@ -573,37 +573,12 @@ static inline void drv_sta_pre_rcu_remov
78 trace_drv_return_void(local);
81 -static inline __must_check
83 int drv_sta_state(struct ieee80211_local *local,
84 struct ieee80211_sub_if_data *sdata,
86 enum ieee80211_sta_state old_state,
87 - enum ieee80211_sta_state new_state)
93 - sdata = get_bss_sdata(sdata);
94 - if (!check_sdata_in_driver(sdata))
97 - trace_drv_sta_state(local, sdata, &sta->sta, old_state, new_state);
98 - if (local->ops->sta_state) {
99 - ret = local->ops->sta_state(&local->hw, &sdata->vif, &sta->sta,
100 - old_state, new_state);
101 - } else if (old_state == IEEE80211_STA_AUTH &&
102 - new_state == IEEE80211_STA_ASSOC) {
103 - ret = drv_sta_add(local, sdata, &sta->sta);
105 - sta->uploaded = true;
106 - } else if (old_state == IEEE80211_STA_ASSOC &&
107 - new_state == IEEE80211_STA_AUTH) {
108 - drv_sta_remove(local, sdata, &sta->sta);
110 - trace_drv_return_int(local, ret);
113 + enum ieee80211_sta_state new_state);
115 static inline void drv_sta_rc_update(struct ieee80211_local *local,
116 struct ieee80211_sub_if_data *sdata,