mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
wifi: iwlwifi: simplify nested if checks
In the absence of (an) else clause(s), "if (a) if (b)" is equivalent to "if (a && b)", so simplify the code a bit. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250102161730.7ddc9cb1ea50.If18bd94706d6c821e34c38a4704bf85dca6207b2@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
bb54c93bd3
commit
63a59880ec
3 changed files with 8 additions and 10 deletions
|
@ -2,7 +2,7 @@
|
|||
/*
|
||||
* Copyright (C) 2012-2014, 2020 Intel Corporation
|
||||
* Copyright (C) 2016 Intel Deutschland GmbH
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022, 2024 Intel Corporation
|
||||
*/
|
||||
#include <net/mac80211.h>
|
||||
#include "fw-api.h"
|
||||
|
@ -158,9 +158,8 @@ int iwl_mvm_binding_remove_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
|
|||
ret = iwl_mvm_binding_update(mvm, vif, mvmvif->deflink.phy_ctxt,
|
||||
false);
|
||||
|
||||
if (!ret)
|
||||
if (iwl_mvm_sf_update(mvm, vif, true))
|
||||
IWL_ERR(mvm, "Failed to update SF state\n");
|
||||
if (!ret && iwl_mvm_sf_update(mvm, vif, true))
|
||||
IWL_ERR(mvm, "Failed to update SF state\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -412,9 +412,8 @@ int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
|||
|
||||
ret = iwl_mvm_link_cmd_send(mvm, &cmd, FW_CTXT_ACTION_REMOVE);
|
||||
|
||||
if (!ret)
|
||||
if (iwl_mvm_sf_update(mvm, vif, true))
|
||||
IWL_ERR(mvm, "Failed to update SF state\n");
|
||||
if (!ret && iwl_mvm_sf_update(mvm, vif, true))
|
||||
IWL_ERR(mvm, "Failed to update SF state\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -146,9 +146,9 @@ static void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans)
|
|||
if (trans_pcie->is_down)
|
||||
return;
|
||||
|
||||
if (trans->state >= IWL_TRANS_FW_STARTED)
|
||||
if (trans_pcie->fw_reset_handshake)
|
||||
iwl_trans_pcie_fw_reset_handshake(trans);
|
||||
if (trans->state >= IWL_TRANS_FW_STARTED &&
|
||||
trans_pcie->fw_reset_handshake)
|
||||
iwl_trans_pcie_fw_reset_handshake(trans);
|
||||
|
||||
trans_pcie->is_down = true;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue