From 50dabc6fcb2433dfc5007382050ad4483e200874 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Tue, 21 Aug 2007 11:53:38 +0800 Subject: [PATCH 19/31] iwlwifi: removing while loop from iwl_print_hex_dump This patch removes while loope for iwl_print_hex_dump. print_hex_dump is already taking care of that. Signed-off-by: Gregory Greenman Signed-off-by: Tomas Winkler Signed-off-by: Zhu Yi --- drivers/net/wireless/iwl-base.c | 11 +++-------- 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/iwl-base.c b/drivers/net/wireless/iwl-base.c index 17f121d..d1b8a6e 100644 --- a/drivers/net/wireless/iwl-base.c +++ b/drivers/net/wireless/iwl-base.c @@ -188,17 +188,11 @@ static const char *iwl_escape_essid(const char *essid, u8 essid_len) static void iwl_print_hex_dump(int level, void *p, u32 len) { #ifdef CONFIG_IWLWIFI_DEBUG - u32 ofs = 0; - if (!(iwl_debug_level & level)) return; - while (len) { - print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, - 16, 1, p + ofs, len, 1); - ofs += 16; - len -= min(len, 16U); - } + print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, 16, 1, + p, len, 1); #endif } @@ -3544,6 +3538,7 @@ int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index) struct iwl_tx_queue *txq = &priv->txq[txq_id]; struct iwl_queue *q = &txq->q; int nfreed = 0; + if ((index >= q->n_bd) || (x2_queue_used(q, index) == 0)) { IWL_ERROR("Read index for DMA queue txq id (%d), index %d, " "is out of range [0-%d] %d %d.\n", txq_id, -- 1.5.2