aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee80211
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@redhat.com>2006-02-26 19:29:51 -0500
committerJohn W. Linville <linville@tuxdriver.com>2006-02-27 20:14:58 -0500
commit07981aa43f6aec32b875f360755ed3d14f9d5139 (patch)
tree21baf289bc23882f058e7ed90f80c76d01408119 /net/ieee80211
parenta23f460dd0c7c9c58b03494c7819e126b2c72383 (diff)
[PATCH] ieee80211_geo.c: remove frivolous BUG_ON's
I have come to consider BUG_ON generally harmful. The idea of an assert is to prevent a program to execute past a point where its state is known erroneous, thus preventing it from dealing more damage to the data (or hiding the traces of malfunction). The problem is, in kernel this harm has to be balanced against the harm of forced reboot. The last straw was our softmac tree, where "iwlist eth1 scan" causes a lockup. It is absolutely frivolus and provides no advantages a normal assert has to provide. In fact, doing this impedes debugging. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/ieee80211')
-rw-r--r--net/ieee80211/ieee80211_geo.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ieee80211/ieee80211_geo.c b/net/ieee80211/ieee80211_geo.c
index 3027153940fc..192243ab35ed 100644
--- a/net/ieee80211/ieee80211_geo.c
+++ b/net/ieee80211/ieee80211_geo.c
@@ -50,7 +50,8 @@ int ieee80211_is_valid_channel(struct ieee80211_device *ieee, u8 channel)
50 50
51 /* Driver needs to initialize the geography map before using 51 /* Driver needs to initialize the geography map before using
52 * these helper functions */ 52 * these helper functions */
53 BUG_ON(ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0); 53 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0)
54 return 0;
54 55
55 if (ieee->freq_band & IEEE80211_24GHZ_BAND) 56 if (ieee->freq_band & IEEE80211_24GHZ_BAND)
56 for (i = 0; i < ieee->geo.bg_channels; i++) 57 for (i = 0; i < ieee->geo.bg_channels; i++)
@@ -78,7 +79,8 @@ int ieee80211_channel_to_index(struct ieee80211_device *ieee, u8 channel)
78 79
79 /* Driver needs to initialize the geography map before using 80 /* Driver needs to initialize the geography map before using
80 * these helper functions */ 81 * these helper functions */
81 BUG_ON(ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0); 82 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0)
83 return -1;
82 84
83 if (ieee->freq_band & IEEE80211_24GHZ_BAND) 85 if (ieee->freq_band & IEEE80211_24GHZ_BAND)
84 for (i = 0; i < ieee->geo.bg_channels; i++) 86 for (i = 0; i < ieee->geo.bg_channels; i++)
@@ -99,7 +101,8 @@ u8 ieee80211_freq_to_channel(struct ieee80211_device * ieee, u32 freq)
99 101
100 /* Driver needs to initialize the geography map before using 102 /* Driver needs to initialize the geography map before using
101 * these helper functions */ 103 * these helper functions */
102 BUG_ON(ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0); 104 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0)
105 return 0;
103 106
104 freq /= 100000; 107 freq /= 100000;
105 108