iwlwifi: don't treat a bool as an error code
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 31 Dec 2012 11:15:36 +0000 (13:15 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 3 Jan 2013 14:32:26 +0000 (15:32 +0100)
iwl_trans_grab_nic_access returns a boolean. So ret should
explicitely set to an error code and not rely on the value
returned by iwl_trans_grab_nic_access.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/dvm/mac80211.c

index 9c1f055f4316741fd51f299eb0f50a2581336a2b..1ed4bc694d2972660bdb49d28093dbd1b32ae09d 100644 (file)
@@ -459,11 +459,11 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
        base = priv->device_pointers.error_event_table;
        if (iwlagn_hw_valid_rtc_data_addr(base)) {
                spin_lock_irqsave(&priv->trans->reg_lock, flags);
-               ret = iwl_trans_grab_nic_access(priv->trans, true);
-               if (likely(ret == 0)) {
+               if (iwl_trans_grab_nic_access(priv->trans, true)) {
                        iwl_write32(priv->trans, HBUS_TARG_MEM_RADDR, base);
                        status = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT);
                        iwl_trans_release_nic_access(priv->trans);
+                       ret = 0;
                }
                spin_unlock_irqrestore(&priv->trans->reg_lock, flags);