• Johannes Berg's avatar
    iwlwifi: remove resp_pkt NULL checks · 0ec971fd
    Johannes Berg authored
    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: default avatarJohannes Berg <johannes.berg@intel.com>
    Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
    0ec971fd
iwl-trans.c 6.29 KB