Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Denys Vlasenko and committed by
Johannes Berg
727da60b 0e0060fc

+44 -27
+1
net/mac80211/Makefile
··· 3 3 # mac80211 objects 4 4 mac80211-y := \ 5 5 main.o status.o \ 6 + driver-ops.o \ 6 7 sta_info.o \ 7 8 wep.o \ 8 9 wpa.o \
+41
net/mac80211/driver-ops.c
··· 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 + }
+2 -27
net/mac80211/driver-ops.h
··· 573 573 trace_drv_return_void(local); 574 574 } 575 575 576 - static inline __must_check 576 + __must_check 577 577 int drv_sta_state(struct ieee80211_local *local, 578 578 struct ieee80211_sub_if_data *sdata, 579 579 struct sta_info *sta, 580 580 enum ieee80211_sta_state old_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 - } 581 + enum ieee80211_sta_state new_state); 607 582 608 583 static inline void drv_sta_rc_update(struct ieee80211_local *local, 609 584 struct ieee80211_sub_if_data *sdata,