iwlwifi: cleanup iwl_recover_from_statistics
authorStanislaw Gruszka <sgruszka@redhat.com>
Tue, 8 Feb 2011 08:31:55 +0000 (09:31 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 9 Feb 2011 21:09:49 +0000 (16:09 -0500)
No functional change, make recover from statistics code
easies to read.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-rx.c

index 87a6fd84d4d25827e7c363638fb31b3b5fbef3c8..bc89393fb696401383a1b05d91196a5f31b23a1b 100644 (file)
@@ -234,33 +234,20 @@ EXPORT_SYMBOL(iwl_rx_spectrum_measure_notif);
 void iwl_recover_from_statistics(struct iwl_priv *priv,
                                struct iwl_rx_packet *pkt)
 {
-       if (test_bit(STATUS_EXIT_PENDING, &priv->status))
+       if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
+           !iwl_is_any_associated(priv))
                return;
-       if (iwl_is_any_associated(priv)) {
-               if (priv->cfg->ops->lib->check_ack_health) {
-                       if (!priv->cfg->ops->lib->check_ack_health(
-                           priv, pkt)) {
-                               /*
-                                * low ack count detected
-                                * restart Firmware
-                                */
-                               IWL_ERR(priv, "low ack count detected, "
-                                       "restart firmware\n");
-                               if (!iwl_force_reset(priv, IWL_FW_RESET, false))
-                                       return;
-                       }
-               }
-               if (priv->cfg->ops->lib->check_plcp_health) {
-                       if (!priv->cfg->ops->lib->check_plcp_health(
-                           priv, pkt)) {
-                               /*
-                                * high plcp error detected
-                                * reset Radio
-                                */
-                               iwl_force_reset(priv, IWL_RF_RESET, false);
-                       }
-               }
+
+       if (priv->cfg->ops->lib->check_ack_health &&
+           !priv->cfg->ops->lib->check_ack_health(priv, pkt)) {
+               IWL_ERR(priv, "low ack count detected, restart firmware\n");
+               if (!iwl_force_reset(priv, IWL_FW_RESET, false))
+                       return;
        }
+
+       if (priv->cfg->ops->lib->check_plcp_health &&
+           !priv->cfg->ops->lib->check_plcp_health(priv, pkt))
+               iwl_force_reset(priv, IWL_RF_RESET, false);
 }
 EXPORT_SYMBOL(iwl_recover_from_statistics);