From patchwork Sun Jan 8 13:56:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 90308 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp463835qgi; Sun, 8 Jan 2017 05:57:24 -0800 (PST) X-Received: by 10.84.234.9 with SMTP id m9mr154906809plk.49.1483883844854; Sun, 08 Jan 2017 05:57:24 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n79si8584487pfa.226.2017.01.08.05.57.24; Sun, 08 Jan 2017 05:57:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938768AbdAHN5I (ORCPT + 4 others); Sun, 8 Jan 2017 08:57:08 -0500 Received: from mail-lf0-f48.google.com ([209.85.215.48]:35089 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937142AbdAHN5H (ORCPT ); Sun, 8 Jan 2017 08:57:07 -0500 Received: by mail-lf0-f48.google.com with SMTP id m78so58938657lfg.2 for ; Sun, 08 Jan 2017 05:57:06 -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; bh=NKO7YVskgAqFiI1BRRm1luVeHWm4GAJ7Ksh4UxCJizE=; b=PNKCm1L2ejrivE8Hs8Nsu9wAHKT2CqaXw8Rr7S4oL2wwzkcTYYMZokXjWagAtst7HK kkbOEtdswYNRiic0STy5CI0vo2C8uMX6cZJSr4p7bRzVH8XaXx/8JawmizrlVw7ydI/y NUyEGRejAWTsjPLxa7yCWxG9HrIzff/tMKWxM= 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=NKO7YVskgAqFiI1BRRm1luVeHWm4GAJ7Ksh4UxCJizE=; b=H+lZeq9tmazZvx0Ru2wfKcbvG9FEnrpiPiQUQYx9720YzSva2EVnRaC/c3qwRbSy2G US904/uEYBQkLgLZqRDOgf8+KKq1VD+i/NgCwhPEvPA/BIW7YZWf4OVJcnowFS9lTxf4 6rb5718mqNqO6PNb4joDWiGm0ORFS7DF2ChsPb34qHnpmSX51FcvkAERRXDRuEpywhdv uff9Ivz2V3rQoK14JmZ50lokHxoqZU/+AjE7e43dbYtbqjsd1zHXc+YIrPTpv2O1tgG2 uq0Nj2TYKx2UqSeuHiMCO+sAR5Q1GHL/tbIdeYrE6UlkCQQdVw47KHHZRttR1b4t4imW 33+A== X-Gm-Message-State: AIkVDXIsp0oe1HonpA6fIlw/N7XHAc4UBIB9Asrz/l4Y5hykPujvyVbTONWdpjQhWK0bXlIU X-Received: by 10.46.87.73 with SMTP id r9mr4077980ljd.22.1483883825445; Sun, 08 Jan 2017 05:57:05 -0800 (PST) Received: from localhost.localdomain (183-224-132-95.pool.ukrtel.net. [95.132.224.183]) by smtp.gmail.com with ESMTPSA id x3sm1036346lfa.7.2017.01.08.05.57.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Jan 2017 05:57:04 -0800 (PST) From: Ivan Khoronzhuk To: netdev@vger.kernel.org, mugunthanvnm@ti.com Cc: linux-omap@vger.kernel.org, grygorii.strashko@ti.com, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH] net: ethernet: ti: cpsw: remove dual check from common res usage function Date: Sun, 8 Jan 2017 15:56:27 +0200 Message-Id: <1483883787-13503-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 --- Based on linux-next/master drivers/net/ethernet/ti/cpsw.c | 3 --- 1 file changed, 3 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index b203143..91684f1 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1235,9 +1235,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++;