Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752605AbdLFVfs (ORCPT ); Wed, 6 Dec 2017 16:35:48 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:55628 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbdLFVfr (ORCPT ); Wed, 6 Dec 2017 16:35:47 -0500 Date: Wed, 06 Dec 2017 16:35:45 -0500 (EST) Message-Id: <20171206.163545.906490902377440615.davem@davemloft.net> To: ivan.khoronzhuk@linaro.org Cc: grygorii.strashko@ti.com, netdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: ethernet: ti: cpdma: rate is not changed - correct case From: David Miller In-Reply-To: <1512571278-13196-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1512571278-13196-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 06 Dec 2017 13:35:46 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 929 Lines: 27 From: Ivan Khoronzhuk Date: Wed, 6 Dec 2017 16:41:18 +0200 > If rate is the same as set it's correct case. > > Signed-off-by: Ivan Khoronzhuk > --- > Based on net-next/master > > drivers/net/ethernet/ti/davinci_cpdma.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c > index e4d6edf..dbe9167 100644 > --- a/drivers/net/ethernet/ti/davinci_cpdma.c > +++ b/drivers/net/ethernet/ti/davinci_cpdma.c > @@ -841,7 +841,7 @@ int cpdma_chan_set_rate(struct cpdma_chan *ch, u32 rate) > return -EINVAL; > > if (ch->rate == rate) > - return rate; > + return 0; Looking at the one and only caller of this function, cpsw_ndo_set_tx_maxrate, it makes sure this can never, ever, happen. So I would instead remove this check completely since it can never trigger.