From patchwork Thu Jan 19 16:58:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 91980 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp378622qgi; Thu, 19 Jan 2017 09:08:38 -0800 (PST) X-Received: by 10.84.232.201 with SMTP id x9mr14825120plm.102.1484845718896; Thu, 19 Jan 2017 09:08:38 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si4089908plm.58.2017.01.19.09.08.38; Thu, 19 Jan 2017 09:08:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-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 netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754050AbdASRII (ORCPT + 5 others); Thu, 19 Jan 2017 12:08:08 -0500 Received: from mail-lf0-f51.google.com ([209.85.215.51]:36727 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753877AbdASRIF (ORCPT ); Thu, 19 Jan 2017 12:08:05 -0500 Received: by mail-lf0-f51.google.com with SMTP id z134so41353459lff.3 for ; Thu, 19 Jan 2017 09:08:04 -0800 (PST) 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=O5kPqVgWycT8yUFnv59Llw6iRNVuy//fI9F3f+o4Ujg=; b=RdOsb0TjaLQn8OGV2fJVVqLNA3Jf/xeItRjGpGJcBe56DJOVgPb95oLYKhn3xCPCdR oktlCHZAbs+jRIdP4FjQZvjbsJm6gkB7lQVKc2JA3d9AbpivJLxtw0JrO/L/r5YiTlKa hJ3Me30LaaWKLS+HzNPoIi6OyDhnefLqtukp0= 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:in-reply-to :references; bh=O5kPqVgWycT8yUFnv59Llw6iRNVuy//fI9F3f+o4Ujg=; b=ELA4znXU/zMVpSj7IXB/3svkWzJ5CYI0QYUlLTqa1a6/cJbZi6P9nPbuCMUQhr/GHo XyLgAVNrluEIqhNAZGG+63Q/FD/5F43P4L79SNxC8wglieEMFN0W+2xUafXh1f5btnZ9 ZJEhxh6c8qQoSx9jywhPe4ijcSzjPDm8FKGq/ssINAYBqHfESnzt08JBjpQ1NZA2CH95 WS8z9HWSluOKIKrmgM1Rovm4Ad1lqOGgOA1KIs+BtLPlyoNd/sf0HTa5ESmT/SGoLBKb qJIUpAlfBzH8HGwk41GEfoogdipSg4L0EvLhVrmPjr73ouQjz7bvoIpsd3PzkGJuv5DF ohBw== X-Gm-Message-State: AIkVDXKBV1SYbEnweO/DvedcmRicusIipR7jt6ZeL17qt083UmBVC7bg7wlu1KWT+Dzam4ji X-Received: by 10.25.74.72 with SMTP id x69mr3315355lfa.66.1484845111613; Thu, 19 Jan 2017 08:58:31 -0800 (PST) Received: from khorivan.synapse.com ([2001:67c:2e5c:2011:b088:28ef:5680:e1cf]) by smtp.gmail.com with ESMTPSA id r27sm2162942ljd.14.2017.01.19.08.58.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Jan 2017 08:58:31 -0800 (PST) From: Ivan Khoronzhuk To: mugunthanvnm@ti.com Cc: grygorii.strashko@ti.com, netdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH v2 1/5] net: ethernet: ti: cpsw: remove dual check from common res usage function Date: Thu, 19 Jan 2017 18:58:23 +0200 Message-Id: <1484845107-30331-2-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484845107-30331-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1484845107-30331-1-git-send-email-ivan.khoronzhuk@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Common res usage is possible only in case an interface is running. In case of not dual emac here can be only one interface, so while ndo_open and switch mode, only one interface can be opened, thus if open is called no any interface is running ... and no common res are used. So remove check on dual emac, it will simplify code/understanding and will match the name it's called. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 3 --- 1 file changed, 3 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 02b03ee..296ddf2 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1240,9 +1240,6 @@ static int cpsw_common_res_usage_state(struct cpsw_common *cpsw) u32 i; u32 usage_count = 0; - if (!cpsw->data.dual_emac) - return 0; - for (i = 0; i < cpsw->data.slaves; i++) if (cpsw->slaves[i].open_stat) usage_count++;