From patchwork Fri Aug 31 15:03:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Stoppa X-Patchwork-Id: 10583997 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84B931709 for ; Fri, 31 Aug 2018 15:03:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77B392C080 for ; Fri, 31 Aug 2018 15:03:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BF4B2BE44; Fri, 31 Aug 2018 15:03:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE8EF2C111 for ; Fri, 31 Aug 2018 15:03:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728039AbeHaTL0 (ORCPT ); Fri, 31 Aug 2018 15:11:26 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43950 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727614AbeHaTL0 (ORCPT ); Fri, 31 Aug 2018 15:11:26 -0400 Received: by mail-lj1-f194.google.com with SMTP id m84-v6so10321424lje.10; Fri, 31 Aug 2018 08:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=E69oyJ5kxilsnkzG5PpQ1Q9o/UeB3+CE8n3MRUqdzy4=; b=Nmx6r78e6InxzD5KRQBg5zYn3rgSfLaT5Yjgkex8Xn74SxiIMnGRxOyFUWutUzMRx8 JrTdDHV3faehLxlE8DPggWbQzKcg8Nt81sldjCg61DMaciC4+pDA0SmYsoO5bSCAiaGx 1fVsUSbJPYOZJxyFx78uY6Vww8Pmuy84ZSzI/+0wzDvz5sFNtNVB7T80Wt3YH0HVE/8Z swr+mJozFcNFq6Nu/61Iiy7haCAyHUuvX3TtsWqMVacup8gq1r599S9dGKEw1cp+doJT WhYQqNf8rrbnmWYo+I+U6owCCTbPmb8PEnMHxnBxO898Ulpcz32k+VD6ZvoqJ60t3mjf F0hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=E69oyJ5kxilsnkzG5PpQ1Q9o/UeB3+CE8n3MRUqdzy4=; b=KZ2NFwZ8gNRdv7vweA6pSs3Jkbg8rjb2bvwSjxLZdTndgK1D7EkR1mGmLzZPU5Wvda xSo9cURrKE2qmw++wVTltT/6gMx8vHTqIjyQA5UAZUTiM7LVvBFLlkhxy98hdzrPJSGp gIliCbCLgIvKythKROpawscpMqmN/RURR3X12GS1PoXa8q40tYPc5ueeR5iGEQBN2ezO yZZ+uPR1tIeu529a/8RH0XBQSlUUPsRJdwYTS/Nm9nXFLRLoEnpO1Gs3rNoLf7IsOtvM sfsPLyhBLZD8vsJP0at+cgZDfVCL4NdBkEB7GSKMS0grz+03TNdnYl3UP+9kqd3862ej PSZw== X-Gm-Message-State: APzg51AoZIyBp+wxmfFJvySJncnqfq6vULZsmzkDJvGi4GcxHN1NL15a 6iwLLRn63sMjFK+miXRuhqY= X-Google-Smtp-Source: ANB0Vdb2Mq2PEbAe5uaQBVpWxRRBL1VtdA6K9MIVod4VShr0QgfqSHQp9vef6sbSxij+TN30msfr/g== X-Received: by 2002:a2e:59d1:: with SMTP id g78-v6mr11124183ljf.79.1535727810557; Fri, 31 Aug 2018 08:03:30 -0700 (PDT) Received: from Mort.jumbo.freeair (91-159-62-202.elisa-laajakaista.fi. [91.159.62.202]) by smtp.gmail.com with ESMTPSA id l16-v6sm1898583lfc.32.2018.08.31.08.03.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 08:03:29 -0700 (PDT) From: Igor Stoppa X-Google-Original-From: Igor Stoppa To: Kalle Valo Cc: igor.stoppa@gmail.com, Igor Stoppa , Christian Lamparter , Michal Kazior , Larry Finger , Linux Kernel Mailing List , Linux Wireless Mailing List Subject: [PATCH] wireless: remove unnecessary unlikely() Date: Fri, 31 Aug 2018 18:03:00 +0300 Message-Id: <20180831150300.2702-1-igor.stoppa@huawei.com> X-Mailer: git-send-email 2.17.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Both WARN_ON() and WARN_ON_ONCE() already contain unlikely(). Signed-off-by: Igor Stoppa Cc: Kalle Valo Cc: Christian Lamparter Cc: Michal Kazior Cc: Larry Finger Cc: Linux Kernel Mailing List Cc: Linux Wireless Mailing List --- drivers/net/wireless/ath/ath10k/htt_rx.c | 4 ++-- drivers/net/wireless/ath/carl9170/tx.c | 4 ++-- drivers/net/wireless/broadcom/b43/dma.c | 2 +- drivers/net/wireless/broadcom/b43legacy/dma.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 4d1cd90d6d27..1455007f3eb8 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -1176,11 +1176,11 @@ static void ath10k_htt_rx_h_undecap_raw(struct ath10k *ar, */ /* This probably shouldn't happen but warn just in case */ - if (unlikely(WARN_ON_ONCE(!is_first))) + if (WARN_ON_ONCE(!is_first)) return; /* This probably shouldn't happen but warn just in case */ - if (unlikely(WARN_ON_ONCE(!(is_first && is_last)))) + if (WARN_ON_ONCE(!(is_first && is_last))) return; skb_trim(msdu, msdu->len - FCS_LEN); diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c index 0cb5b58925dc..8c75651ede6c 100644 --- a/drivers/net/wireless/ath/carl9170/tx.c +++ b/drivers/net/wireless/ath/carl9170/tx.c @@ -246,8 +246,8 @@ static void carl9170_release_dev_space(struct ar9170 *ar, struct sk_buff *skb) * of available memory blocks, so the number can * never execeed the mem_blocks count. */ - if (unlikely(WARN_ON_ONCE(cookie == 0) || - WARN_ON_ONCE(cookie > ar->fw.mem_blocks))) + if (WARN_ON_ONCE(cookie == 0) || + WARN_ON_ONCE(cookie > ar->fw.mem_blocks)) return; atomic_add(DIV_ROUND_UP(skb->len, ar->fw.mem_block_size), diff --git a/drivers/net/wireless/broadcom/b43/dma.c b/drivers/net/wireless/broadcom/b43/dma.c index 6b0e1ec346cb..d113bd997f4b 100644 --- a/drivers/net/wireless/broadcom/b43/dma.c +++ b/drivers/net/wireless/broadcom/b43/dma.c @@ -1432,7 +1432,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb) goto out; } - if (unlikely(WARN_ON(free_slots(ring) < TX_SLOTS_PER_FRAME))) { + if (WARN_ON(free_slots(ring) < TX_SLOTS_PER_FRAME)) { /* If we get here, we have a real error with the queue * full, but queues not stopped. */ b43err(dev->wl, "DMA queue overflow\n"); diff --git a/drivers/net/wireless/broadcom/b43legacy/dma.c b/drivers/net/wireless/broadcom/b43legacy/dma.c index 2f0c64cef65f..1b1da7d83652 100644 --- a/drivers/net/wireless/broadcom/b43legacy/dma.c +++ b/drivers/net/wireless/broadcom/b43legacy/dma.c @@ -1149,7 +1149,7 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev, return -ENOSPC; } - if (unlikely(WARN_ON(free_slots(ring) < SLOTS_PER_PACKET))) { + if (WARN_ON(free_slots(ring) < SLOTS_PER_PACKET)) { /* If we get here, we have a real error with the queue * full, but queues not stopped. */ b43legacyerr(dev->wl, "DMA queue overflow\n");