iwlwifi: remove resp_pkt NULL checks
authorJohannes Berg <johannes.berg@intel.com>
Mon, 10 Apr 2017 08:32:58 +0000 (10:32 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 22 Jun 2017 21:12:59 +0000 (00:12 +0300)
commit0ec971fdaddfcab72e5104e35774f489991f1f68
treec13780b1cacf93a6d4a8cfc6d37d43e90d5dda6d
parent664e968be329352d2ed2566e43965a25421b1646
iwlwifi: remove resp_pkt NULL checks

Contrary to what some of the comments say, if rfkill was
asserted the transport will return -ERFKILL instead of
success, if CMD_WANT_SKB was set, so it's not necessary
to check cmd.resp_pkt for being NULL if the return code
was success.

Validate that this is true in iwl_trans_send_cmd().

Most of the other code modifications were done with the
following spatch:
    @@
    struct iwl_host_cmd cmd;
    identifier pkt;
    @@
    <...
    (
    pkt = cmd.resp_pkt;
    ...
    -if (!pkt) { ... }
    |
    pkt = cmd.resp_pkt;
    ...
    -if (WARN_ON(!pkt)) { ... }
    |
    -if (!cmd.resp_pkt) { ... }
    )
    ...>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-trans.c
drivers/net/wireless/intel/iwlwifi/mvm/d3.c
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
drivers/net/wireless/intel/iwlwifi/mvm/utils.c