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: 9503465 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 8DD5860710 for ; Sun, 8 Jan 2017 13:57:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AC16283E1 for ; Sun, 8 Jan 2017 13:57:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D7EC28403; Sun, 8 Jan 2017 13:57:25 +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 E8C16283E1 for ; Sun, 8 Jan 2017 13:57:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938768AbdAHN5I (ORCPT ); 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 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 --- Based on linux-next/master 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 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++;