mac80211: Deinline drv_switch_vif_chanctx()
authorDenys Vlasenko <dvlasenk@redhat.com>
Wed, 23 Sep 2015 12:18:34 +0000 (14:18 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 29 Sep 2015 13:56:48 +0000 (15:56 +0200)
With this .config: http://busybox.net/~vda/kernel_config_ALLYES_Os,
after deinlining the function size is 821 bytes and there are
2 callsites, reducing code size by about 800 bytes.

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
[adjust code-style a bit]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/driver-ops.c
net/mac80211/driver-ops.h

index b284e6e0c376a719b0d6a2cd14b97c52a9caa272..1a720e890d4086d065accf65c62af04a534b454f 100644 (file)
@@ -138,3 +138,54 @@ int drv_conf_tx(struct ieee80211_local *local,
        trace_drv_return_int(local, ret);
        return ret;
 }
+
+int drv_switch_vif_chanctx(struct ieee80211_local *local,
+                          struct ieee80211_vif_chanctx_switch *vifs,
+                          int n_vifs, enum ieee80211_chanctx_switch_mode mode)
+{
+       int ret = 0;
+       int i;
+
+       if (!local->ops->switch_vif_chanctx)
+               return -EOPNOTSUPP;
+
+       for (i = 0; i < n_vifs; i++) {
+               struct ieee80211_chanctx *new_ctx =
+                       container_of(vifs[i].new_ctx,
+                                    struct ieee80211_chanctx,
+                                    conf);
+               struct ieee80211_chanctx *old_ctx =
+                       container_of(vifs[i].old_ctx,
+                                    struct ieee80211_chanctx,
+                                    conf);
+
+               WARN_ON_ONCE(!old_ctx->driver_present);
+               WARN_ON_ONCE((mode == CHANCTX_SWMODE_SWAP_CONTEXTS &&
+                             new_ctx->driver_present) ||
+                            (mode == CHANCTX_SWMODE_REASSIGN_VIF &&
+                             !new_ctx->driver_present));
+       }
+
+       trace_drv_switch_vif_chanctx(local, vifs, n_vifs, mode);
+       ret = local->ops->switch_vif_chanctx(&local->hw,
+                                            vifs, n_vifs, mode);
+       trace_drv_return_int(local, ret);
+
+       if (!ret && mode == CHANCTX_SWMODE_SWAP_CONTEXTS) {
+               for (i = 0; i < n_vifs; i++) {
+                       struct ieee80211_chanctx *new_ctx =
+                               container_of(vifs[i].new_ctx,
+                                            struct ieee80211_chanctx,
+                                            conf);
+                       struct ieee80211_chanctx *old_ctx =
+                               container_of(vifs[i].old_ctx,
+                                            struct ieee80211_chanctx,
+                                            conf);
+
+                       new_ctx->driver_present = true;
+                       old_ctx->driver_present = false;
+               }
+       }
+
+       return ret;
+}
index 0baeefdd89a01446451856b2b2e0decc8fbe3713..275146eee646023e47c863334692ba4cae8ab504 100644 (file)
@@ -1002,58 +1002,9 @@ static inline void drv_unassign_vif_chanctx(struct ieee80211_local *local,
        trace_drv_return_void(local);
 }
 
-static inline int
-drv_switch_vif_chanctx(struct ieee80211_local *local,
-                      struct ieee80211_vif_chanctx_switch *vifs,
-                      int n_vifs,
-                      enum ieee80211_chanctx_switch_mode mode)
-{
-       int ret = 0;
-       int i;
-
-       if (!local->ops->switch_vif_chanctx)
-               return -EOPNOTSUPP;
-
-       for (i = 0; i < n_vifs; i++) {
-               struct ieee80211_chanctx *new_ctx =
-                       container_of(vifs[i].new_ctx,
-                                    struct ieee80211_chanctx,
-                                    conf);
-               struct ieee80211_chanctx *old_ctx =
-                       container_of(vifs[i].old_ctx,
-                                    struct ieee80211_chanctx,
-                                    conf);
-
-               WARN_ON_ONCE(!old_ctx->driver_present);
-               WARN_ON_ONCE((mode == CHANCTX_SWMODE_SWAP_CONTEXTS &&
-                             new_ctx->driver_present) ||
-                            (mode == CHANCTX_SWMODE_REASSIGN_VIF &&
-                             !new_ctx->driver_present));
-       }
-
-       trace_drv_switch_vif_chanctx(local, vifs, n_vifs, mode);
-       ret = local->ops->switch_vif_chanctx(&local->hw,
-                                            vifs, n_vifs, mode);
-       trace_drv_return_int(local, ret);
-
-       if (!ret && mode == CHANCTX_SWMODE_SWAP_CONTEXTS) {
-               for (i = 0; i < n_vifs; i++) {
-                       struct ieee80211_chanctx *new_ctx =
-                               container_of(vifs[i].new_ctx,
-                                            struct ieee80211_chanctx,
-                                            conf);
-                       struct ieee80211_chanctx *old_ctx =
-                               container_of(vifs[i].old_ctx,
-                                            struct ieee80211_chanctx,
-                                            conf);
-
-                       new_ctx->driver_present = true;
-                       old_ctx->driver_present = false;
-               }
-       }
-
-       return ret;
-}
+int drv_switch_vif_chanctx(struct ieee80211_local *local,
+                          struct ieee80211_vif_chanctx_switch *vifs,
+                          int n_vifs, enum ieee80211_chanctx_switch_mode mode);
 
 static inline int drv_start_ap(struct ieee80211_local *local,
                               struct ieee80211_sub_if_data *sdata)