projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36ec144
)
net: wireless: make a const array static, makes object smaller
author
Colin Ian King
<colin.king@canonical.com>
Mon, 16 Nov 2020 18:16:36 +0000
(18:16 +0000)
committer
Johannes Berg
<johannes.berg@intel.com>
Fri, 11 Dec 2020 11:50:02 +0000
(12:50 +0100)
Don't populate the const array bws on the stack but instead it
static. Makes the object code smaller by 80 bytes:
Before:
text data bss dec hex filename
85694 16865 1216 103775 1955f ./net/wireless/reg.o
After:
text data bss dec hex filename
85518 16961 1216 103695 1950f ./net/wireless/reg.o
(gcc version 10.2.0)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link:
https://lore.kernel.org/r/20201116181636.362729-1-colin.king@canonical.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/reg.c
patch
|
blob
|
history
diff --git
a/net/wireless/reg.c
b/net/wireless/reg.c
index a04fdfb35f070eeed7b558f8a696db27daf4afa9..c037960e5a1a82e9283bc4c96e12b6c7c8b13b7f 100644
(file)
--- a/
net/wireless/reg.c
+++ b/
net/wireless/reg.c
@@
-1616,7
+1616,7
@@
static const struct ieee80211_reg_rule *
__freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 min_bw)
{
const struct ieee80211_regdomain *regd = reg_get_regdomain(wiphy);
- const u32 bws[] = {0, 1, 2, 4, 5, 8, 10, 16, 20};
+
static
const u32 bws[] = {0, 1, 2, 4, 5, 8, 10, 16, 20};
const struct ieee80211_reg_rule *reg_rule;
int i = ARRAY_SIZE(bws) - 1;
u32 bw;