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: 9266073 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EAD906075A for ; Sat, 6 Aug 2016 21:43:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC5AC26AE3 for ; Sat, 6 Aug 2016 21:43:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0EA82840E; Sat, 6 Aug 2016 21:43:53 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 598E726AE3 for ; Sat, 6 Aug 2016 21:43:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752149AbcHFVnw (ORCPT ); Sat, 6 Aug 2016 17:43:52 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:36528 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751110AbcHFVnw (ORCPT ); Sat, 6 Aug 2016 17:43:52 -0400 Received: by mail-lf0-f52.google.com with SMTP id g62so224488330lfe.3 for ; Sat, 06 Aug 2016 14:43:51 -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=TjoHB6u2aGRH5MvxMrMi4nusRSRbFknWV+rm4uhfOUEOBkaIn9YhrkaV4+yzGLf/Sz v5XS3J9k3jFqi74ojDX3+SWH04HnOc6XvTruPxgDYXm8QZ91nf3eyDiwSTQrTy+q0EDN AQgILyZ6OWmz1eFpUxKZUWOpdTDuLBD7TUBD0tPerMXHHntPgHG96fiW5xjVxm/QAj7f 9pFz4LNQvNhXRpG5OVZU2XCSmd/be7v/zYJvImxi7RXAsa1Y6E1tNQFWmOyDu/7Uy1UZ 3XpUQvTbpLeGOozAVqLJOMbiTxWMIKgDMfygjELgvGHJBEhZXy1dKJEAe1BJVq35WBnx si9w== X-Gm-Message-State: AEkoouuE6ySOetCk+BQ7b6pALfuWXvAtzfTLD2vvYnzk/i2/D0lx+PYpY5jRMYhcg87e9TfZ 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-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Mugunthan V N --- drivers/net/ethernet/ti/cpsw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)) ? \