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: 9526499 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 6D6406045A for ; Thu, 19 Jan 2017 17:24:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5889228649 for ; Thu, 19 Jan 2017 17:24:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CDDD28657; Thu, 19 Jan 2017 17:24:33 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 C7A5B28651 for ; Thu, 19 Jan 2017 17:24:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753798AbdASRY1 (ORCPT ); Thu, 19 Jan 2017 12:24:27 -0500 Received: from mail-lf0-f50.google.com ([209.85.215.50]:35785 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753782AbdASRYZ (ORCPT ); Thu, 19 Jan 2017 12:24:25 -0500 Received: by mail-lf0-f50.google.com with SMTP id n124so41650760lfd.2 for ; Thu, 19 Jan 2017 09:24:25 -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=nNS9Ixp6YbvqGLnPThqlLXgre1N0fosgSBv1yrXzMbGRH43jSbksUo6pua2TT4eHJj 37h5WLzienzKOJSmf1cffZDTJ4HLA0Uo9v6SFIHw2/IEMpxm1AU0ztbk75EKJXeXXzcQ RZJU08sqB5IScR0jHqxS53rbS/P6GWSqMQEJP0tipSW9Ml2N9u3RG/OJ5895p+qzZXSf C/maxo5Rag3qaojmUNbSScNCr0QM4L2Xc/Ok0EWrK8ff/jqgISXoFL+OYG6IZkqMp6A3 Z+7AWFj2Yw1PUfH9BKggL9e6nIQOX0Up2jZ/kuCL9YTm/5CYMDllUC0CxKRDu/YfbIFa F2Qw== X-Gm-Message-State: AIkVDXKmG1kOc87XjuVbRsMtcHPZ9QPcHovcQpPksiZKVXobf+hM7KeKrvyIMjCwVtYnQZE0 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: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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++;