iwlwifi: remove unnecessary code in iwl_trans_alloc_tx_cmd
authorLuca Coelho <luciano.coelho@intel.com>
Wed, 5 Apr 2017 06:42:18 +0000 (09:42 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 5 Jun 2017 20:34:31 +0000 (23:34 +0300)
When we removed dev_cmd_headroom, the check for dev_cmd_ptr == NULL
became unnecessary, since we just return dev_cmd_ptr anyway.  Cleanup
the function to avoid useless code.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-trans.h

index e965285f84f1fa2c9633d1a0ae87ebd57aa02ee7..a150da3c824b8370e0b29a844eed08fc20129e67 100644 (file)
@@ -908,13 +908,7 @@ iwl_trans_dump_data(struct iwl_trans *trans,
 static inline struct iwl_device_cmd *
 iwl_trans_alloc_tx_cmd(struct iwl_trans *trans)
 {
-       struct iwl_device_cmd *dev_cmd_ptr =
-               kmem_cache_alloc(trans->dev_cmd_pool, GFP_ATOMIC);
-
-       if (unlikely(dev_cmd_ptr == NULL))
-               return NULL;
-
-       return dev_cmd_ptr;
+       return kmem_cache_alloc(trans->dev_cmd_pool, GFP_ATOMIC);
 }
 
 int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd);