From patchwork Thu Aug 4 21:14:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 73323 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1600964qga; Thu, 4 Aug 2016 14:16:06 -0700 (PDT) X-Received: by 10.98.54.134 with SMTP id d128mr130092027pfa.150.1470345346676; Thu, 04 Aug 2016 14:15:46 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sz2si3413557pac.129.2016.08.04.14.15.46; Thu, 04 Aug 2016 14:15:46 -0700 (PDT) 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966692AbcHDVOq (ORCPT + 4 others); Thu, 4 Aug 2016 17:14:46 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:34073 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966638AbcHDVOo (ORCPT ); Thu, 4 Aug 2016 17:14:44 -0400 Received: by mail-lf0-f48.google.com with SMTP id l69so190482136lfg.1 for ; Thu, 04 Aug 2016 14:14:43 -0700 (PDT) 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=VK8d6UeWO2F1EMoB9BSbm7ssiG7gilIZX8k0kTuwCRM=; b=FL3HJEIKVQPyKvsz+EqBBUPSpGisQQmLgpHd8nruf7AVU5Tn9VDR3l3et7Ve5gs/4w k4g3ZkPoOyEOk5qaB9MS6LfCeuqqo4qdCr5yStoU6hRiznSl0wvuY9c9zW1quQ9Xdh3h MXIWSRc8oIqAKsyi7FJwUUdQLEhFJZcAECABU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VK8d6UeWO2F1EMoB9BSbm7ssiG7gilIZX8k0kTuwCRM=; b=gClzYUZRJU157bBtQaqhkDDCvj242lpRhoXWGkOPjE6ehuJCeJdjrS28mCt28r2aWQ to7MteZvx83x/hmdT7VXkbLA2iYwNADvejF4/Sd549GlOHrrKaIpi9u1jzmV/Wt7zK55 BZthKA9nJqE4hZPhVnsZ+dirjfDThVwOFIEBZM6pP8UAaQ+eZHRF76wlQlzBxkZr0BoR q4xYsUlOYwaZVWhWW14R9Fjp3QRKiyBRS2TPllRrDxRD0yxZdnZocTixK4Fq9wJLqvki wZvE+9qOHOqv/uOwpsWxIg4lS94La3JYrpb1P4TS7HKMCeQxSO4SrKF1cgMIKpo3cUl+ zTxg== X-Gm-Message-State: AEkooutvQnj+2Va5BRb1FzJP7ZJO85AUIbuNQq2m5nlJrmTrrEF5+FnJFvZ6Bo4QQcf40dSo X-Received: by 10.25.215.145 with SMTP id q17mr24308857lfi.30.1470345282609; Thu, 04 Aug 2016 14:14:42 -0700 (PDT) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id g74sm2697427ljg.24.2016.08.04.14.14.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Aug 2016 14:14:41 -0700 (PDT) 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 2/3] net: ethernet: ti: cpsw: remove redundant check in napi poll Date: Fri, 5 Aug 2016 00:14:31 +0300 Message-Id: <1470345272-874-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470345272-874-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1470345272-874-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 No need to check number of handled packets, when in most cases (> 99%) it's not 0. It can be 0 only in rarely cases, even in this case it's not bad to print just 0. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 8972bf6..85ee9f5 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -793,9 +793,7 @@ static int cpsw_tx_poll(struct napi_struct *napi_tx, int budget) } } - if (num_tx) - cpsw_dbg(priv, intr, "poll %d tx pkts\n", num_tx); - + cpsw_dbg(priv, intr, "poll %d tx pkts\n", num_tx); return num_tx; } @@ -814,9 +812,7 @@ static int cpsw_rx_poll(struct napi_struct *napi_rx, int budget) } } - if (num_rx) - cpsw_dbg(priv, intr, "poll %d rx pkts\n", num_rx); - + cpsw_dbg(priv, intr, "poll %d rx pkts\n", num_rx); return num_rx; }