Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5926506pxj; Wed, 23 Jun 2021 12:02:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnx8PUzvvuTsEHviUUP+Ay3Nex8aKR50fWnJ3J2EwcD0J7phfCI8oaP5QItANBO2X5k4/x X-Received: by 2002:a92:c563:: with SMTP id b3mr650213ilj.275.1624474956783; Wed, 23 Jun 2021 12:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624474956; cv=none; d=google.com; s=arc-20160816; b=QdCFDrMIRplAB+TyyuLFDKleYqCjzRu7qkXCE1asYdGyky2nWKHC1RIOCkj9QMJf06 vxBJP+PUV/8bzMdbaLYAswJ7H1o7Joh+AN/mjsdFgnMCLUkfznfHhjzicKsM5Z7L+hGb XMoL9csrzHWrRl7LZhjmE8LWhsZL/0R0xcOwHdAuAeDvIAMlIKH33DFliA9AK4H0xJaq cbQfttQBvUAUmAl7qJha5tdaiq/MngUS5YZXz1V8rLg/RnE4gHTTWVkJxnQo+uR5zW1a +GbLpXwjNy/cUF33uUEXiWZ66TgFK60Bjz0A5z7idf1nXWh3ZwnM179iQ9TOKQujLVfr HKhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=xzc7uAXBpkPjqlgcCHF7B4wRp7w59C7otpHRLXni4xE=; b=SxR15LFD3cON0AbAY4dqe1TcwE3ONz29tK1CJCqxtHI8UckZP9ZvLyLKZL9nyktbMG W3PhPdbES0U6+61y/nseo8jFhAOK5UDEwQTGVxMS9avmxoLsyvmI/CCzeSz8Q4dWbkwX T5HvMzsl5i6jZOlvSn/5/vuwyHUADVaY6XFB2BOLAybiZ0fjhE5L0b5xp7+yv774TNFw tvyMdzukkNld+diCYY0A0bV75ilWSeEkvQwP94yR7ETtzjs3fnakZYhbOk+5UqZVGHD1 kQ5Fkf/XWIN8cMP4hBt7c5SUAOl/mpc7j7istZgpv9yNIkPwilnLJwdihznBSTYrK/vc 2rJQ== 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 p2si374343iln.150.2021.06.23.12.02.18; Wed, 23 Jun 2021 12:02:36 -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 S229916AbhFWTDZ (ORCPT + 99 others); Wed, 23 Jun 2021 15:03:25 -0400 Received: from h4.fbrelay.privateemail.com ([131.153.2.45]:51170 "EHLO h4.fbrelay.privateemail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbhFWTDZ (ORCPT ); Wed, 23 Jun 2021 15:03:25 -0400 X-Greylist: delayed 883 seconds by postgrey-1.27 at vger.kernel.org; Wed, 23 Jun 2021 15:03:24 EDT Received: from MTA-06-3.privateemail.com (mta-06.privateemail.com [68.65.122.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h3.fbrelay.privateemail.com (Postfix) with ESMTPS id 718C8809C4; Wed, 23 Jun 2021 14:46:23 -0400 (EDT) Received: from MTA-06.privateemail.com (localhost [127.0.0.1]) by MTA-06.privateemail.com (Postfix) with ESMTP id E826C600BA; Wed, 23 Jun 2021 14:46:21 -0400 (EDT) Received: from hal-station.. (unknown [10.20.151.223]) by MTA-06.privateemail.com (Postfix) with ESMTPA id 11D5760071; Wed, 23 Jun 2021 14:46:20 -0400 (EDT) From: Hamza Mahfooz To: linux-kernel@vger.kernel.org Cc: Luca Coelho , Kalle Valo , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Hamza Mahfooz Subject: [PATCH] iwlwifi: remove redundant calls to unlikely() Date: Wed, 23 Jun 2021 14:45:46 -0400 Message-Id: <20210623184546.14769-1-someguy@effective-light.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org As per commit a7f3d3d3600c ("dma-mapping: add unlikely hint to error path in dma_mapping_error"), dma_mapping_error now internally calls unlikely(), so we don't need to call it directly anymore. Signed-off-by: Hamza Mahfooz --- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 10 +++++----- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c index 4f6c187eed69..3bf56d30f741 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c @@ -1253,7 +1253,7 @@ static int iwl_fill_data_tbs(struct iwl_trans *trans, struct sk_buff *skb, dma_addr_t tb_phys = dma_map_single(trans->dev, skb->data + hdr_len, head_tb_len, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(trans->dev, tb_phys))) + if (dma_mapping_error(trans->dev, tb_phys)) return -EINVAL; trace_iwlwifi_dev_tx_tb(trans->dev, skb, skb->data + hdr_len, tb_phys, head_tb_len); @@ -1272,7 +1272,7 @@ static int iwl_fill_data_tbs(struct iwl_trans *trans, struct sk_buff *skb, tb_phys = skb_frag_dma_map(trans->dev, frag, 0, skb_frag_size(frag), DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(trans->dev, tb_phys))) + if (dma_mapping_error(trans->dev, tb_phys)) return -EINVAL; trace_iwlwifi_dev_tx_tb(trans->dev, skb, skb_frag_address(frag), tb_phys, skb_frag_size(frag)); @@ -1380,7 +1380,7 @@ static int iwl_fill_data_tbs_amsdu(struct iwl_trans *trans, struct sk_buff *skb, hdr_tb_len = hdr_page->pos - start_hdr; hdr_tb_phys = dma_map_single(trans->dev, start_hdr, hdr_tb_len, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(trans->dev, hdr_tb_phys))) + if (dma_mapping_error(trans->dev, hdr_tb_phys)) return -EINVAL; iwl_pcie_txq_build_tfd(trans, txq, hdr_tb_phys, hdr_tb_len, false); @@ -1400,7 +1400,7 @@ static int iwl_fill_data_tbs_amsdu(struct iwl_trans *trans, struct sk_buff *skb, tb_phys = dma_map_single(trans->dev, tso.data, size, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(trans->dev, tb_phys))) + if (dma_mapping_error(trans->dev, tb_phys)) return -EINVAL; iwl_pcie_txq_build_tfd(trans, txq, tb_phys, @@ -1551,7 +1551,7 @@ int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, /* map the data for TB1 */ tb1_addr = ((u8 *)&dev_cmd->hdr) + IWL_FIRST_TB_SIZE; tb1_phys = dma_map_single(trans->dev, tb1_addr, tb1_len, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(trans->dev, tb1_phys))) + if (dma_mapping_error(trans->dev, tb1_phys)) goto out_err; iwl_pcie_txq_build_tfd(trans, txq, tb1_phys, tb1_len, false); diff --git a/drivers/net/wireless/intel/iwlwifi/queue/tx.c b/drivers/net/wireless/intel/iwlwifi/queue/tx.c index 451b06069350..2b409fb33c99 100644 --- a/drivers/net/wireless/intel/iwlwifi/queue/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/queue/tx.c @@ -211,7 +211,7 @@ static int iwl_txq_gen2_set_tb_with_wa(struct iwl_trans *trans, struct page *page; int ret; - if (unlikely(dma_mapping_error(trans->dev, phys))) + if (dma_mapping_error(trans->dev, phys)) return -ENOMEM; if (likely(!iwl_txq_crosses_4g_boundary(phys, len))) { @@ -251,7 +251,7 @@ static int iwl_txq_gen2_set_tb_with_wa(struct iwl_trans *trans, phys = dma_map_single(trans->dev, page_address(page), len, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(trans->dev, phys))) + if (dma_mapping_error(trans->dev, phys)) return -ENOMEM; ret = iwl_txq_gen2_set_tb(trans, tfd, phys, len); if (ret < 0) { @@ -405,7 +405,7 @@ static int iwl_txq_gen2_build_amsdu(struct iwl_trans *trans, tb_len = hdr_page->pos - start_hdr; tb_phys = dma_map_single(trans->dev, start_hdr, tb_len, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(trans->dev, tb_phys))) + if (dma_mapping_error(trans->dev, tb_phys)) goto out_err; /* * No need for _with_wa, this is from the TSO page and @@ -487,7 +487,7 @@ iwl_tfh_tfd *iwl_txq_gen2_build_tx_amsdu(struct iwl_trans *trans, /* map the data for TB1 */ tb1_addr = ((u8 *)&dev_cmd->hdr) + IWL_FIRST_TB_SIZE; tb_phys = dma_map_single(trans->dev, tb1_addr, len, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(trans->dev, tb_phys))) + if (dma_mapping_error(trans->dev, tb_phys)) goto out_err; /* * No need for _with_wa(), we ensure (via alignment) that the data @@ -582,7 +582,7 @@ iwl_tfh_tfd *iwl_txq_gen2_build_tx(struct iwl_trans *trans, /* map the data for TB1 */ tb1_addr = ((u8 *)&dev_cmd->hdr) + IWL_FIRST_TB_SIZE; tb_phys = dma_map_single(trans->dev, tb1_addr, tb1_len, DMA_TO_DEVICE); - if (unlikely(dma_mapping_error(trans->dev, tb_phys))) + if (dma_mapping_error(trans->dev, tb_phys)) goto out_err; /* * No need for _with_wa(), we ensure (via alignment) that the data -- 2.32.0