Get rid of a pile of WARN_ON()

This commit is contained in:
Solomon Peachy 2013-02-21 17:02:02 -05:00
parent db04efd195
commit e93f3f1774
3 changed files with 20 additions and 25 deletions

View File

@ -577,10 +577,10 @@ int cw1200_core_probe(const struct sbus_ops *sbus_ops,
}
/* Set low-power mode. */
WARN_ON(wsm_set_operational_mode(priv, &mode));
wsm_set_operational_mode(priv, &mode);
/* Enable multi-TX confirmation */
WARN_ON(wsm_use_multi_tx_conf(priv, true));
wsm_use_multi_tx_conf(priv, true);
#ifdef CONFIG_CW1200_ETF
skip_fw:

View File

@ -162,8 +162,7 @@ void cw1200_scan_work(struct work_struct *work)
if (!priv->scan.req || (priv->scan.curr == priv->scan.end)) {
if (priv->scan.output_power != priv->output_power)
WARN_ON(wsm_set_output_power(priv,
priv->output_power * 10));
wsm_set_output_power(priv, priv->output_power * 10);
if (priv->join_status == CW1200_JOIN_STATUS_STA &&
!(priv->powersave_mode.mode & WSM_PSM_PS))
cw1200_set_pm(priv, &priv->powersave_mode);
@ -343,7 +342,7 @@ void cw1200_scan_timeout(struct work_struct *work)
"Timeout waiting for scan complete notification.\n");
priv->scan.status = -ETIMEDOUT;
priv->scan.curr = priv->scan.end;
WARN_ON(wsm_stop_scan(priv));
wsm_stop_scan(priv);
}
cw1200_scan_complete(priv);
}
@ -437,11 +436,11 @@ void cw1200_probe_work(struct work_struct *work)
/* FW bug: driver has to restart p2p-dev mode after scan */
if (priv->join_status == CW1200_JOIN_STATUS_MONITOR)
cw1200_disable_listening(priv);
ret = WARN_ON(wsm_set_template_frame(priv, &frame));
ret = wsm_set_template_frame(priv, &frame);
priv->scan.direct_probe = 1;
if (!ret) {
wsm_flush_tx(priv);
ret = WARN_ON(cw1200_scan_start(priv, &scan));
ret = cw1200_scan_start(priv, &scan);
}
mutex_unlock(&priv->conf_mutex);

View File

@ -264,8 +264,7 @@ void tx_policy_clean(struct cw1200_common *priv)
entry = &cache->cache[idx];
/* Policy usage count should be 0 at this time as all queues
should be empty */
if (entry->policy.usage_count) {
WARN_ON(1);
if (WARN_ON(entry->policy.usage_count)) {
entry->policy.usage_count = 0;
list_move(&entry->link, &cache->free);
}
@ -390,7 +389,7 @@ void tx_policy_upload_work(struct work_struct *work)
container_of(work, struct cw1200_common, tx_policy_upload_work);
pr_debug("[TX] TX policy upload.\n");
WARN_ON(tx_policy_upload(priv));
tx_policy_upload(priv);
wsm_unlock_tx(priv);
cw1200_tx_queues_unlock(priv);
@ -888,7 +887,7 @@ void cw1200_tx_confirm_cb(struct cw1200_common *priv,
link_id,
cw1200_queue_get_generation(arg->packet_id) + 1,
priv->sta_asleep_mask);
WARN_ON(cw1200_queue_requeue(queue, arg->packet_id));
cw1200_queue_requeue(queue, arg->packet_id);
spin_lock_bh(&priv->ps_state_lock);
if (!link_id) {
priv->buffered_multicasts = true;
@ -898,8 +897,8 @@ void cw1200_tx_confirm_cb(struct cw1200_common *priv,
}
}
spin_unlock_bh(&priv->ps_state_lock);
} else if (!WARN_ON(cw1200_queue_get_skb(queue, arg->packet_id,
&skb, &txpriv))) {
} else if (!cw1200_queue_get_skb(queue, arg->packet_id,
&skb, &txpriv)) {
struct ieee80211_tx_info *tx = IEEE80211_SKB_CB(skb);
int tx_count = arg->ack_failures;
u8 ht_flags = 0;
@ -1023,10 +1022,7 @@ void cw1200_rx_cb(struct cw1200_common *priv,
ieee80211_is_action(frame->frame_control) &&
(mgmt->u.action.category == WLAN_CATEGORY_PUBLIC)) {
pr_debug("[RX] Going to MAP&RESET link ID\n");
if (work_pending(&priv->linkid_reset_work))
WARN_ON(1);
WARN_ON(work_pending(&priv->linkid_reset_work));
memcpy(&priv->action_frame_sa[0],
ieee80211_get_SA(frame), ETH_ALEN);
priv->action_linkid = 0;
@ -1038,8 +1034,7 @@ void cw1200_rx_cb(struct cw1200_common *priv,
(mgmt->u.action.category == WLAN_CATEGORY_PUBLIC)) {
/* Link ID already exists for the ACTION frame.
* Reset and Remap */
if (work_pending(&priv->linkid_reset_work))
WARN_ON(1);
WARN_ON(work_pending(&priv->linkid_reset_work));
memcpy(&priv->action_frame_sa[0],
ieee80211_get_SA(frame), ETH_ALEN);
priv->action_linkid = link_id;
@ -1117,7 +1112,8 @@ void cw1200_rx_cb(struct cw1200_common *priv,
icv_len = 16 /* WAPI_MIC_LEN */;
break;
default:
WARN_ON("Unknown encryption type");
pr_warning("Unknown encryption type %d\n",
WSM_RX_STATUS_ENCRYPTION(arg->flags));
goto drop;
}
@ -1400,10 +1396,10 @@ void cw1200_link_id_gc_work(struct work_struct *work)
spin_unlock_bh(&priv->ps_state_lock);
if (need_reset) {
reset.link_id = i + 1;
WARN_ON(wsm_reset(priv, &reset));
wsm_reset(priv, &reset);
}
map_link.link_id = i + 1;
WARN_ON(wsm_map_link(priv, &map_link));
wsm_map_link(priv, &map_link);
next_gc = min(next_gc, CW1200_LINK_ID_GC_TIMEOUT);
spin_lock_bh(&priv->ps_state_lock);
} else if (priv->link_id_db[i].status == CW1200_LINK_SOFT) {
@ -1418,7 +1414,7 @@ void cw1200_link_id_gc_work(struct work_struct *work)
memset(map_link.mac_addr, 0, ETH_ALEN);
spin_unlock_bh(&priv->ps_state_lock);
reset.link_id = i + 1;
WARN_ON(wsm_reset(priv, &reset));
wsm_reset(priv, &reset);
spin_lock_bh(&priv->ps_state_lock);
} else {
next_gc = min_t(unsigned long, next_gc, ttl);
@ -1432,13 +1428,13 @@ void cw1200_link_id_gc_work(struct work_struct *work)
priv->link_id_db[i].timestamp = now;
reset.link_id = i + 1;
spin_unlock_bh(&priv->ps_state_lock);
WARN_ON(wsm_reset(priv, &reset));
wsm_reset(priv, &reset);
if (status == CW1200_LINK_RESET_REMAP) {
memcpy(map_link.mac_addr,
priv->link_id_db[i].mac,
ETH_ALEN);
map_link.link_id = i + 1;
WARN_ON(wsm_map_link(priv, &map_link));
wsm_map_link(priv, &map_link);
next_gc = min(next_gc,
CW1200_LINK_ID_GC_TIMEOUT);
}