iwlwifi: pcie: remove some dead code
authorJohannes Berg <johannes.berg@intel.com>
Sat, 25 Apr 2020 10:04:52 +0000 (13:04 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 8 May 2020 06:52:51 +0000 (09:52 +0300)
We can never get into this code with a gen2/3 device, and therefore
don't need to allocate the byte count tables in a single contiguous
DMA region. Just WARN and bail out if something is misconfigured.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200425130140.a748d33252ef.If2f5810016efb40b041f93fe8c6b4c251542e2f1@changeid
drivers/net/wireless/intel/iwlwifi/pcie/tx.c

index 4582d418ba4dfb45f5c3a103edbaf8c0f0e1b59e..9ff78bca460b2fc95233083f9c9f5078a4528f68 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
- * Copyright(c) 2018 - 2019 Intel Corporation
+ * Copyright(c) 2018 - 2020 Intel Corporation
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@
  * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
- * Copyright(c) 2018 - 2019 Intel Corporation
+ * Copyright(c) 2018 - 2020 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -954,10 +954,10 @@ static int iwl_pcie_tx_alloc(struct iwl_trans *trans)
        struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
        u16 bc_tbls_size = trans->trans_cfg->base_params->num_of_queues;
 
-       bc_tbls_size *= (trans->trans_cfg->device_family >=
-                        IWL_DEVICE_FAMILY_AX210) ?
-               sizeof(struct iwl_gen3_bc_tbl) :
-               sizeof(struct iwlagn_scd_bc_tbl);
+       if (WARN_ON(trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210))
+               return -EINVAL;
+
+       bc_tbls_size *= sizeof(struct iwlagn_scd_bc_tbl);
 
        /*It is not allowed to alloc twice, so warn when this happens.
         * We cannot rely on the previous allocation, so free and fail */