Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2077184imm; Fri, 7 Sep 2018 10:25:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYwNc57F3h7ELMHNv8qtjCbjGVH+cmRLtHgp0EPv8xu0Fni+TdoS2Xa8XOZk8DiFyCKPA6R X-Received: by 2002:a62:9349:: with SMTP id b70-v6mr9740811pfe.193.1536341132610; Fri, 07 Sep 2018 10:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536341132; cv=none; d=google.com; s=arc-20160816; b=jUfGUdWpDcAggY6YJzYqpb5/Gisbl6aYzIBHtImWlRHcoOTtDyA5ZoiURBxloYU8nM dVZu2JvNiRF2pmaAk5FLe35cM/XH883RhIPB0BsUcG4gPxDSMtDLsTTXJQAgWMi5PP/8 1zWYWaP3i1+rMnIW+CE4fR1Q2ajgI9QmcQCxfFSIbM5IDc7F08SRsD2VuVLX1271Er4w RKXJ+Ki/vQEs1RLA6bI4tL+RrfwVlwnvy0Uykz6vF+Uy6ct1ZdQKewzXm1bE25oUwv/j JAazr5YcXko4Q5QDOpDaglVqRQHebMbMgqxYmXTQtrX56JLAFjjDBTsAFqDx26qG3Bc5 dZNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=0XuIO/jwwbkrA/dGaqPCq8DyOayB0G1pbKNSu+Mm5vo=; b=cYyLZ98Mjx6qSuZDZRCe2OAXX8HEIcWwKNJ3747YHWJHUHIOVEWPXA4zjL658seIgI bCotRfRqYr43n5UGKNrnM6YLzmSxAIxy6RW3KJtk8KIcA/ixtZcIPOHgS+3+Zc7na0KY 5OHWfy4DDgbkcsYlln4vmrbCZBpCsYMHcO0VKo2tx6b/iJWWsJzkp1vcUR9JSBc2zEX3 u+wNj5CYnCZSRJHZrusr+7Zx9AxEqS7txdNJXeMAlDPAqfuk1vWuGEC/DQa37T/r2lAg p+xQlDN3gaEAOyMShc75sgWKUihR0TboKbqShM+jqbpeTNKQxLvJ6B56gB/qYhCtW0qn GkkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="N/qODpBB"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z125-v6si9066139pfz.10.2018.09.07.10.25.16; Fri, 07 Sep 2018 10:25:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="N/qODpBB"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727637AbeIGWFX (ORCPT + 99 others); Fri, 7 Sep 2018 18:05:23 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:39434 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeIGWFX (ORCPT ); Fri, 7 Sep 2018 18:05:23 -0400 Received: by mail-lf1-f66.google.com with SMTP id v77-v6so12643313lfa.6; Fri, 07 Sep 2018 10:23:27 -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=0XuIO/jwwbkrA/dGaqPCq8DyOayB0G1pbKNSu+Mm5vo=; b=N/qODpBBscn+KPIBg8H4O3hiHNYFrxGYMjmle1pXYypNs8hkbwlUPsZ+txTWwmcb6O yYrLNa8WMvtyzkpHWe+31V58zyDvD4OkU8bD5GhmFkuNGBFI4RfDFnsuirrz+Ncpvm7g Clv82UCAYBsoOF+YoDgE9I0EcbwaXPfDLOdQWSgkkxAcWbr/91FzXbWE7sGP+mc2zQcd BIR3EsgrfkF6U5T8S47eAoK2nOeauwiJiff2QGlxRgIlcmprwxZIZXhxp90xY7/Ck7/F ZcdNgl6I4eagNWYuUgwjbfttZKUuDEJwwQ4tHzLzP06fdajfA2BhInlKgp9bMZTvw51q L8KA== 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=0XuIO/jwwbkrA/dGaqPCq8DyOayB0G1pbKNSu+Mm5vo=; b=uJ9IGHGClFVxyoRXdQweAPuuiY5lUaa5IZg8sdI2jcKLPzwfjzN6vX4Q2B6fYF4rJ6 w3HMYaNZKkT1ScJNuMw0qqz9nuTCYFs5lCSOfUoCBOTpC91DEDuo6vDHEhjDhz0tHFNx zalvWbFbtyrmkQ0IuGpqDkMyn8qn9A78fRrwAgCXDL/dJrzoOceSlVznFjk7gkRbaBIy UyHDOZ0q+kAqmGSZF4C1+ptCkx0zjlIBiVjkFxBg80u9/0zBRFwQnwDpZtbYnkIihS/M P7wcuiaG8OeypTYBv36p52kWQwukh9kaUSlIN2YyyethpCWHSBaWzzSSoeBgWEWMwgd8 Cq7w== X-Gm-Message-State: APzg51DRnGnFe5tZuEmHaxhKztB+jepQJDkkg4qklgE6gixSyWEQY8kW Bc//XdtbaSsqSv3Y8x2SMnI= X-Received: by 2002:a19:9e85:: with SMTP id h127-v6mr5505067lfe.89.1536341006505; Fri, 07 Sep 2018 10:23:26 -0700 (PDT) Received: from Mort.jumbo.freeair (91-156-179-220.elisa-laajakaista.fi. [91.156.179.220]) by smtp.gmail.com with ESMTPSA id q16-v6sm1377686ljj.68.2018.09.07.10.23.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 10:23:25 -0700 (PDT) From: Igor Stoppa X-Google-Original-From: Igor Stoppa To: Madalin Bucur Cc: igor.stoppa@gmail.com, Igor Stoppa , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] freescale: ethernet: remove unnecessary unlikely() Date: Fri, 7 Sep 2018 20:23:18 +0300 Message-Id: <20180907172318.29014-1-igor.stoppa@huawei.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Both WARN_ON() and WARN_ONCE() already contain an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Madalin Bucur Cc: "David S. Miller" Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 65a22cd9aef2..783134f1b779 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -1280,7 +1280,7 @@ static int dpaa_bman_release(const struct dpaa_bp *dpaa_bp, err = bman_release(dpaa_bp->pool, bmb, cnt); /* Should never occur, address anyway to avoid leaking the buffers */ - if (unlikely(WARN_ON(err)) && dpaa_bp->free_buf_cb) + if (WARN_ON(err) && dpaa_bp->free_buf_cb) while (cnt-- > 0) dpaa_bp->free_buf_cb(dpaa_bp, &bmb[cnt]); @@ -1704,10 +1704,8 @@ static struct sk_buff *contig_fd_to_skb(const struct dpaa_priv *priv, skb = build_skb(vaddr, dpaa_bp->size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info))); - if (unlikely(!skb)) { - WARN_ONCE(1, "Build skb failure on Rx\n"); + if (WARN_ONCE(!skb, "Build skb failure on Rx\n")) goto free_buffer; - } WARN_ON(fd_off != priv->rx_headroom); skb_reserve(skb, fd_off); skb_put(skb, qm_fd_get_length(fd)); @@ -1770,7 +1768,7 @@ static struct sk_buff *sg_fd_to_skb(const struct dpaa_priv *priv, sz = dpaa_bp->size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); skb = build_skb(sg_vaddr, sz); - if (WARN_ON(unlikely(!skb))) + if (WARN_ON(!skb)) goto free_buffers; skb->ip_summed = rx_csum_offload(priv, fd); -- 2.17.1