From patchwork Sat Aug 6 10:48:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 73393 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp2541770qga; Sat, 6 Aug 2016 14:50:19 -0700 (PDT) X-Received: by 10.66.5.72 with SMTP id q8mr37180323paq.38.1470520219138; Sat, 06 Aug 2016 14:50:19 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si27116198pal.10.2016.08.06.14.50.18; Sat, 06 Aug 2016 14:50:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1752196AbcHFVuR (ORCPT + 27 others); Sat, 6 Aug 2016 17:50:17 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:34762 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059AbcHFVuP (ORCPT ); Sat, 6 Aug 2016 17:50:15 -0400 Received: by mail-lf0-f41.google.com with SMTP id l69so224636790lfg.1 for ; Sat, 06 Aug 2016 14:50:15 -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=wW/jNbF1ROHvGqyEq34mPcR+QzgRiTv3pDr4gnA+4iQ=; b=N4hGNg1rfoNlxdei90egzzdaBT96I+PcySWFdVtt5M05hrUpbG7l+uIPSjGpixG+l1 W2YtvECa5Gmtl3CYlzOBSBpt0r8f/XI/b5kSPoz4nzAbUd5e3uDlCTqLaPFzwvNqCiHx yzKdKJ2eZayslj1zXmRLoFionlV2y4iZ5AqX8= 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=wW/jNbF1ROHvGqyEq34mPcR+QzgRiTv3pDr4gnA+4iQ=; b=STZCCFwcXGb75BzZauJi1xFDO5FCyzy/iqMc/eDNx4ISKhnXxako91xxsRk6zkMYKt mHF7czz1c+AFsKQOjTGfnwIH/FihxrIZ94Ay20HgtQNFwCx9I+i6KNLq1AfNbfxNjAa0 f3WMvG6GhFAM6ckUJ/UfxKg/lR+QxFlb8yFgilr7kjOTPz28GWt9bBJYgiTVM2us10Ip 1TAc/TPl2/s1HzTaXVuA4fkzEzhn15plfHNvOlCtL4KKjahNqGWegIORm0OMuQlLKbZJ 9+dGoAhibiYdJWuRucavAcgIAbx3B3mRvn/y5LuyeTbgLDls4KRjBrdw4DHvu3Fybz/N McxQ== X-Gm-Message-State: AEkoouv6KBgEMwKeG7jRIPvJoZLfd/IqsHKlPMsXn7qdMVZNyNeC8PcqNSQlqg6AcrfxF6Mx X-Received: by 10.25.160.139 with SMTP id j133mr22188534lfe.227.1470480540504; Sat, 06 Aug 2016 03:49:00 -0700 (PDT) Received: from localhost.localdomain (153-224-132-95.pool.ukrtel.net. [95.132.224.153]) by smtp.gmail.com with ESMTPSA id p128sm3916360lfb.32.2016.08.06.03.48.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 06 Aug 2016 03:49:00 -0700 (PDT) From: Ivan Khoronzhuk To: netdev@vger.kernel.org, mugunthanvnm@ti.com, grygorii.strashko@ti.com Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, dlide@ti.com, Ivan Khoronzhuk Subject: [PATCH v2 02/14] net: ethernet: ti: cpsw: remove redundant check in napi poll Date: Sat, 6 Aug 2016 13:48:32 +0300 Message-Id: <1470480524-6851-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470480524-6851-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1470480524-6851-1-git-send-email-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 rare 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; }