aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-09-08 11:44:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-11 15:53:36 -0400
commitee96d6ef82cc29421569b7cb7f7c7ee90168ec50 (patch)
tree8b403bc60843c48140b00490e047d49b3340c37a
parent491775a50787b9fbb09b5735be3d111c65935f5c (diff)
mac80211: remove useless non-NULL tests from scan results code
I'm surprised nobody complained about these before. What a waste. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/mlme.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index f60212b75005..ba502ce132d9 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3822,6 +3822,7 @@ ieee80211_sta_scan_result(struct ieee80211_local *local,
3822 char *current_ev, char *end_buf) 3822 char *current_ev, char *end_buf)
3823{ 3823{
3824 struct iw_event iwe; 3824 struct iw_event iwe;
3825 char *buf;
3825 3826
3826 if (time_after(jiffies, 3827 if (time_after(jiffies,
3827 bss->last_update + IEEE80211_SCAN_RESULT_EXPIRE)) 3828 bss->last_update + IEEE80211_SCAN_RESULT_EXPIRE))
@@ -3896,7 +3897,7 @@ ieee80211_sta_scan_result(struct ieee80211_local *local,
3896 3897
3897 ieee80211_sta_add_scan_ies(info, bss, &current_ev, end_buf); 3898 ieee80211_sta_add_scan_ies(info, bss, &current_ev, end_buf);
3898 3899
3899 if (bss && bss->supp_rates_len > 0) { 3900 if (bss->supp_rates_len > 0) {
3900 /* display all supported rates in readable format */ 3901 /* display all supported rates in readable format */
3901 char *p = current_ev + iwe_stream_lcp_len(info); 3902 char *p = current_ev + iwe_stream_lcp_len(info);
3902 int i; 3903 int i;
@@ -3915,30 +3916,25 @@ ieee80211_sta_scan_result(struct ieee80211_local *local,
3915 current_ev = p; 3916 current_ev = p;
3916 } 3917 }
3917 3918
3918 if (bss) { 3919 buf = kmalloc(30, GFP_ATOMIC);
3919 char *buf; 3920 if (buf) {
3920 buf = kmalloc(30, GFP_ATOMIC); 3921 memset(&iwe, 0, sizeof(iwe));
3921 if (buf) { 3922 iwe.cmd = IWEVCUSTOM;
3922 memset(&iwe, 0, sizeof(iwe)); 3923 sprintf(buf, "tsf=%016llx", (unsigned long long)(bss->timestamp));
3923 iwe.cmd = IWEVCUSTOM; 3924 iwe.u.data.length = strlen(buf);
3924 sprintf(buf, "tsf=%016llx", (unsigned long long)(bss->timestamp)); 3925 current_ev = iwe_stream_add_point(info, current_ev, end_buf,
3925 iwe.u.data.length = strlen(buf); 3926 &iwe, buf);
3926 current_ev = iwe_stream_add_point(info, current_ev, 3927 memset(&iwe, 0, sizeof(iwe));
3927 end_buf, 3928 iwe.cmd = IWEVCUSTOM;
3928 &iwe, buf); 3929 sprintf(buf, " Last beacon: %dms ago",
3929 memset(&iwe, 0, sizeof(iwe)); 3930 jiffies_to_msecs(jiffies - bss->last_update));
3930 iwe.cmd = IWEVCUSTOM; 3931 iwe.u.data.length = strlen(buf);
3931 sprintf(buf, " Last beacon: %dms ago", 3932 current_ev = iwe_stream_add_point(info, current_ev,
3932 jiffies_to_msecs(jiffies - bss->last_update)); 3933 end_buf, &iwe, buf);
3933 iwe.u.data.length = strlen(buf); 3934 kfree(buf);
3934 current_ev = iwe_stream_add_point(info, current_ev,
3935 end_buf, &iwe, buf);
3936 kfree(buf);
3937 }
3938 } 3935 }
3939 3936
3940 if (bss_mesh_cfg(bss)) { 3937 if (bss_mesh_cfg(bss)) {
3941 char *buf;
3942 u8 *cfg = bss_mesh_cfg(bss); 3938 u8 *cfg = bss_mesh_cfg(bss);
3943 buf = kmalloc(50, GFP_ATOMIC); 3939 buf = kmalloc(50, GFP_ATOMIC);
3944 if (buf) { 3940 if (buf) {