From patchwork Sat Aug 6 10:48:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 73387 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp2519839qga; Sat, 6 Aug 2016 13:13:59 -0700 (PDT) X-Received: by 10.66.233.38 with SMTP id tt6mr146493264pac.99.1470514439137; Sat, 06 Aug 2016 13:13:59 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si27664853paq.222.2016.08.06.13.13.58; Sat, 06 Aug 2016 13:13:59 -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=@linaro.org; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751686AbcHFUN4 (ORCPT + 27 others); Sat, 6 Aug 2016 16:13:56 -0400 Received: from mail-lf0-f46.google.com ([209.85.215.46]:33792 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751530AbcHFUNy (ORCPT ); Sat, 6 Aug 2016 16:13:54 -0400 Received: by mail-lf0-f46.google.com with SMTP id l69so223921722lfg.1 for ; Sat, 06 Aug 2016 13:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=G6YDom5OcLEFhWxLi5xmWh3aAfHOW/i0X+PO7SsUZDI=; b=iD0eOpOcw5ucjBP8z7KDG/OdejUQRT/4ur5Un0x4RI8qPspPoya3wMorTix+jrpVqU SOPwKlvnZx45S9QC28VJmeF1QsnXv9GpnMY3XZmsbVNOuQ+UV7ntMY2VpCvLl4LvyEh3 jMYT3oN6XMWqdgZSUy/pMSjfpxlfan46FrhmE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=G6YDom5OcLEFhWxLi5xmWh3aAfHOW/i0X+PO7SsUZDI=; b=WDqw6k28yvkpzbmqdeyz2r6H44QsNprNN7dWZQiC4Vr2bGho8nC6kpdc9jtWRBPS5o Bi7VgzDXtpr/mqFOCQNQB54rolQjx6gB6DVP2zx4ea9aHpYQBog7+lsSItcbOZQDVyN/ 14HZzdvAKftRjKzn0tDz9j15mmtmNsHLF9r9Ftd4EadvYnpe9FCaOcYN5EaYzUQ1vOEQ yM+dLnaNDfuaYHprT7QLBHWAEXxaIIjbccweCgg6KSmHewKfBucPIWYkTjSC4lQzlLhE oZGv5HqUY3ZBpy9OD9cvwSeg1dirjLJOyE9oMvBJaDxFkG3vPVKMygnS3s7HNqrHaiEk 6uYw== X-Gm-Message-State: AEkoouvcfJMlnQbxx7mvX3vQyIWJWvO4Gh0VYNjh/LAOUlDBFnOBUMuaO5gZU/WJITNM+ztK X-Received: by 10.25.151.132 with SMTP id z126mr872852lfd.224.1470480543776; Sat, 06 Aug 2016 03:49:03 -0700 (PDT) Received: from localhost.localdomain (153-224-132-95.pool.ukrtel.net. [95.132.224.153]) by smtp.gmail.com with ESMTPSA id p128sm3916360lfb.32.2016.08.06.03.49.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 06 Aug 2016 03:49:03 -0700 (PDT) From: Ivan Khoronzhuk To: netdev@vger.kernel.org, mugunthanvnm@ti.com, grygorii.strashko@ti.com Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, dlide@ti.com, Ivan Khoronzhuk Subject: [PATCH v2 05/14] net: ethernet: ti: cpsw: don't check slave num in runtime Date: Sat, 6 Aug 2016 13:48:35 +0300 Message-Id: <1470480524-6851-6-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470480524-6851-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1470480524-6851-1-git-send-email-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No need to check const slave num in runtime for every packet, and ndev for slaves w/o ndev is anyway NULL. So remove redundant check. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 1.9.1 diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 70a9570..19aa4bb 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -498,8 +498,7 @@ static const struct cpsw_stats cpsw_gstrings_stats[] = { (func)(slave++, ##arg); \ } while (0) #define cpsw_get_slave_ndev(priv, __slave_no__) \ - ((__slave_no__ < priv->data.slaves) ? \ - priv->slaves[__slave_no__].ndev : NULL) + priv->slaves[__slave_no__].ndev #define cpsw_get_slave_priv(priv, __slave_no__) \ (((__slave_no__ < priv->data.slaves) && \ (priv->slaves[__slave_no__].ndev)) ? \