Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp731400ybz; Sat, 25 Apr 2020 03:06:14 -0700 (PDT) X-Google-Smtp-Source: APiQypKpegm0pT5PL3wifzRPNmTzP/BfTTBmq3nQKlDNWXd5Dw21ZF/NDKe0I2MahgruADS2rH+w X-Received: by 2002:aa7:cdcb:: with SMTP id h11mr10509526edw.264.1587809174338; Sat, 25 Apr 2020 03:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587809174; cv=none; d=google.com; s=arc-20160816; b=Bpp63mClQHPPACBfvR+neEyL8eImyryDjINKa2ZrlD7uzzpchXG/SRo26Zh7nkFaEq fs3u5it4N42wRik/B6JZcMwHYSlYVrEmlrRZ3E2tGgdt5Wbd9s5gutmfptLgPKJ7Of2K +xJVrSUsKD5n7FvEvihkK7QWSlcHzoAAKNVc3Wu6Rgyhawq9pisNQ6QRQtJUYp8FGYSa Rx8gSA5p1IUgIdnqyJlfT0DtVSTFlx3DJ8lJll3BvW77d4+HiTPdtl9iHhS4CFNLCVUL +0yEpO8YzK0gbaYlXYlRVg0BQxQwsUP9GfxqeXjMaQDhwuPPNX3WBc2cPmPjZI/el5Yf cuZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from; bh=NYeVuBRJyeojGjdb1VXGUGvZakpSlXyqTMR276Jtzhk=; b=qCiRYdsqTLEiBzjBLF7RCKQbFVoKoCfhjnQLNDnS5AfvfpoWG4d9XaqN3xGUEzSd7J ekAVvGtS05b3Gc7iUU2Y7WMPgAMsYAQoZXcLdTLZQtPldXzDGzIp8Vk0a9EYNyBXlpuY DdOw/f0tWWP0EQqfa+kmjvZxipUtpJcaNZDE04be3BQ48lwgngEXtR03VNzHM1azW0jA tqysS0gwp0RIhIJbz2Jt7BIO7iWup7XVG+DSLQ7/mT3lY+62u/WdEHjJC29TaoxTOSI7 WMq+NpI6qmZaM46L+d4btDF2Ri25T7FVRDs0Qxrp4M7EGmkXIMTKtaBHZREXhEVyPIOp ihmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si4508217edv.539.2020.04.25.03.05.38; Sat, 25 Apr 2020 03:06:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726327AbgDYKFO (ORCPT + 99 others); Sat, 25 Apr 2020 06:05:14 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:58230 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726304AbgDYKFO (ORCPT ); Sat, 25 Apr 2020 06:05:14 -0400 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jSHgN-000P3t-Un; Sat, 25 Apr 2020 13:05:12 +0300 From: Luca Coelho To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org Date: Sat, 25 Apr 2020 13:04:52 +0300 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200425100459.2778317-1-luca@coelho.fi> References: <20200425100459.2778317-1-luca@coelho.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on farmhouse.coelho.fi X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, TVD_RCVD_IP autolearn=ham autolearn_force=no version=3.4.4 Subject: [PATCH 04/11] iwlwifi: pcie: remove some dead code Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg 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 Signed-off-by: Luca Coelho --- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c index 4582d418ba4d..9ff78bca460b 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c @@ -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 */ -- 2.26.2