diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-04-18 12:12:37 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-04-18 12:14:30 -0400 |
commit | 3e41ace5deef7af16dd277d9d17f9d36dca0a10e (patch) | |
tree | 213bf23ffeaede74cddd033ccd45a1d45e9d3f3b /drivers/net/wireless/iwlwifi/iwl-agn.c | |
parent | e79b1ca75bb48111e8d93fc576f50e24671f5f9d (diff) |
iwlagn: remove most BUG_ON instances
There are a number of things in the driver that
may result in a BUG(), which is suboptimal since
it's hard to get debugging information out of
the driver in that case and the user experience
is also not good :-)
Almost all BUG_ON instances can be converted to
WARN_ON with a few lines of appropriate error
handling, so do that instead.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index b4f7510f51e..0daededb0ff 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -394,7 +394,9 @@ int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, | |||
394 | return -EINVAL; | 394 | return -EINVAL; |
395 | } | 395 | } |
396 | 396 | ||
397 | BUG_ON(addr & ~DMA_BIT_MASK(36)); | 397 | if (WARN_ON(addr & ~DMA_BIT_MASK(36))) |
398 | return -EINVAL; | ||
399 | |||
398 | if (unlikely(addr & ~IWL_TX_DMA_MASK)) | 400 | if (unlikely(addr & ~IWL_TX_DMA_MASK)) |
399 | IWL_ERR(priv, "Unaligned address = %llx\n", | 401 | IWL_ERR(priv, "Unaligned address = %llx\n", |
400 | (unsigned long long)addr); | 402 | (unsigned long long)addr); |
@@ -718,7 +720,10 @@ static void iwl_rx_handle(struct iwl_priv *priv) | |||
718 | /* If an RXB doesn't have a Rx queue slot associated with it, | 720 | /* If an RXB doesn't have a Rx queue slot associated with it, |
719 | * then a bug has been introduced in the queue refilling | 721 | * then a bug has been introduced in the queue refilling |
720 | * routines -- catch it here */ | 722 | * routines -- catch it here */ |
721 | BUG_ON(rxb == NULL); | 723 | if (WARN_ON(rxb == NULL)) { |
724 | i = (i + 1) & RX_QUEUE_MASK; | ||
725 | continue; | ||
726 | } | ||
722 | 727 | ||
723 | rxq->queue[i] = NULL; | 728 | rxq->queue[i] = NULL; |
724 | 729 | ||