提交 ee96d6ef 编写于 作者: J Johannes Berg 提交者: John W. Linville

mac80211: remove useless non-NULL tests from scan results code

I'm surprised nobody complained about these before. What a waste.
Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 491775a5
...@@ -3822,6 +3822,7 @@ ieee80211_sta_scan_result(struct ieee80211_local *local, ...@@ -3822,6 +3822,7 @@ ieee80211_sta_scan_result(struct ieee80211_local *local,
char *current_ev, char *end_buf) char *current_ev, char *end_buf)
{ {
struct iw_event iwe; struct iw_event iwe;
char *buf;
if (time_after(jiffies, if (time_after(jiffies,
bss->last_update + IEEE80211_SCAN_RESULT_EXPIRE)) bss->last_update + IEEE80211_SCAN_RESULT_EXPIRE))
...@@ -3896,7 +3897,7 @@ ieee80211_sta_scan_result(struct ieee80211_local *local, ...@@ -3896,7 +3897,7 @@ ieee80211_sta_scan_result(struct ieee80211_local *local,
ieee80211_sta_add_scan_ies(info, bss, &current_ev, end_buf); ieee80211_sta_add_scan_ies(info, bss, &current_ev, end_buf);
if (bss && bss->supp_rates_len > 0) { if (bss->supp_rates_len > 0) {
/* display all supported rates in readable format */ /* display all supported rates in readable format */
char *p = current_ev + iwe_stream_lcp_len(info); char *p = current_ev + iwe_stream_lcp_len(info);
int i; int i;
...@@ -3915,30 +3916,25 @@ ieee80211_sta_scan_result(struct ieee80211_local *local, ...@@ -3915,30 +3916,25 @@ ieee80211_sta_scan_result(struct ieee80211_local *local,
current_ev = p; current_ev = p;
} }
if (bss) { buf = kmalloc(30, GFP_ATOMIC);
char *buf; if (buf) {
buf = kmalloc(30, GFP_ATOMIC); memset(&iwe, 0, sizeof(iwe));
if (buf) { iwe.cmd = IWEVCUSTOM;
memset(&iwe, 0, sizeof(iwe)); sprintf(buf, "tsf=%016llx", (unsigned long long)(bss->timestamp));
iwe.cmd = IWEVCUSTOM; iwe.u.data.length = strlen(buf);
sprintf(buf, "tsf=%016llx", (unsigned long long)(bss->timestamp)); current_ev = iwe_stream_add_point(info, current_ev, end_buf,
iwe.u.data.length = strlen(buf); &iwe, buf);
current_ev = iwe_stream_add_point(info, current_ev, memset(&iwe, 0, sizeof(iwe));
end_buf, iwe.cmd = IWEVCUSTOM;
&iwe, buf); sprintf(buf, " Last beacon: %dms ago",
memset(&iwe, 0, sizeof(iwe)); jiffies_to_msecs(jiffies - bss->last_update));
iwe.cmd = IWEVCUSTOM; iwe.u.data.length = strlen(buf);
sprintf(buf, " Last beacon: %dms ago", current_ev = iwe_stream_add_point(info, current_ev,
jiffies_to_msecs(jiffies - bss->last_update)); end_buf, &iwe, buf);
iwe.u.data.length = strlen(buf); kfree(buf);
current_ev = iwe_stream_add_point(info, current_ev,
end_buf, &iwe, buf);
kfree(buf);
}
} }
if (bss_mesh_cfg(bss)) { if (bss_mesh_cfg(bss)) {
char *buf;
u8 *cfg = bss_mesh_cfg(bss); u8 *cfg = bss_mesh_cfg(bss);
buf = kmalloc(50, GFP_ATOMIC); buf = kmalloc(50, GFP_ATOMIC);
if (buf) { if (buf) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册