From patchwork Sun Jan 8 16:41:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 9503527 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 B06026071A for ; Sun, 8 Jan 2017 16:42:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C0E327F88 for ; Sun, 8 Jan 2017 16:42:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 909AD2833A; Sun, 8 Jan 2017 16:42:35 +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 16A7B27F88 for ; Sun, 8 Jan 2017 16:42:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754129AbdAHQmR (ORCPT ); Sun, 8 Jan 2017 11:42:17 -0500 Received: from mail-lf0-f49.google.com ([209.85.215.49]:34177 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753555AbdAHQlJ (ORCPT ); Sun, 8 Jan 2017 11:41:09 -0500 Received: by mail-lf0-f49.google.com with SMTP id v186so27263404lfa.1 for ; Sun, 08 Jan 2017 08:41:09 -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=kvpjoIqNhs8d0SQF7sSoTDwEZHDfRvL8uXO1rKuVxzg=; b=iJU91DWi0kOPD9eWU4v2+bIwdUhksBUkqpNGY4fbS03b6hXt34jw2O6KDe9Yznv3HA cUvy4vvWwl5xaUP9T1laixaNDdLZYB8pFTLhqakCc+aY7vgyvCrv0lwJZkbeTUG9HlBJ ANiL+zmjQd42tvfDl5FMZAd3g3Pml5B+a5dv4= 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=kvpjoIqNhs8d0SQF7sSoTDwEZHDfRvL8uXO1rKuVxzg=; b=qbFa16NVCeKoq5gQtdTPsrY6qPdmEpnpRRlTo39SdASjbvlmZLC33vt2HvQfihI7J2 ZT6euhkgYf1WmaKDT1o5u0/K8nbzhu2E1fwvuoux7p4wmyxJ4nKd91PF2I/9PwyyTqHg +wjFLSG47qDiV1Lxm+oiKRpMcx9OU4pM/jjoFgZeS+iEURIv2mL7r6rN8Zu74VZr7pzy HIQlV3nuYoXYh5Sgxj5mXHK6CbRWCsMA5iXV99Rtbl+v2WdR7PDmbicGZufCKgH2lTN6 uAAJJ2LP/YT/BZDPXgbcU13xDH+rMCbrLmuvXoYBN07vFoIOQcwK+L9wkTJwBa3kbQBf ZwQw== X-Gm-Message-State: AIkVDXIIWwkVVyCn21TdmIi7o4vZEZ866OzDrxcTksqOF61D/QQQBn3BUxtBN6aar9al5+Kb X-Received: by 10.46.71.204 with SMTP id u195mr6322267lja.71.1483893668251; Sun, 08 Jan 2017 08:41:08 -0800 (PST) Received: from localhost.localdomain (183-224-132-95.pool.ukrtel.net. [95.132.224.183]) by smtp.gmail.com with ESMTPSA id c77sm20196895lfg.29.2017.01.08.08.41.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Jan 2017 08:41:07 -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 1/4] net: ethernet: ti: cpsw: remove dual check from common res usage function Date: Sun, 8 Jan 2017 18:41:00 +0200 Message-Id: <1483893663-15673-2-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483893663-15673-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1483893663-15673-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 f339268..d261024 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++;