Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752207AbbEDHyH (ORCPT ); Mon, 4 May 2015 03:54:07 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:40894 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752069AbbEDHxF (ORCPT ); Mon, 4 May 2015 03:53:05 -0400 From: Laurent Pinchart To: Nicholas Mc Guire Cc: Vinod Koul , Nicholas Mc Guire , Kuninori Morimoto , David Woodhouse , Brian Norris , Wolfram Sang , Arnd Bergmann , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] mtd: sh_flctl: drop unused variable Date: Mon, 04 May 2015 10:53:28 +0300 Message-ID: <3139913.OhcnyJWC3N@avalon> User-Agent: KMail/4.14.3 (Linux/3.18.11-gentoo; KDE/4.14.3; x86_64; ; ) In-Reply-To: <20150504060346.GB26350@opentech.at> References: <1430553430-21396-1-git-send-email-hofrat@osadl.org> <20150504051723.GW3521@localhost> <20150504060346.GB26350@opentech.at> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2258 Lines: 51 Hi Nicholas, On Monday 04 May 2015 08:03:46 Nicholas Mc Guire wrote: > On Mon, 04 May 2015, Vinod Koul wrote: > > On Sun, May 03, 2015 at 10:33:43PM +0300, Laurent Pinchart wrote: > > > On Saturday 02 May 2015 09:57:08 Nicholas Mc Guire wrote: > > > > shdma_tx_submit() called via dmaengine_submit() returns the assigned > > > > cookie but this is not used here so the variable and assignment can > > > > be dropped. > > > > > > > > Signed-off-by: Nicholas Mc Guire > > > > > > I would rephrase the commit message to avoid mentioning > > > shdma_tx_submit() as that's not relevant. Something like > > > "dmaengine_submit() returns the assigned cookie but this is not used > > > here so the variable and assignment can be dropped." > > > > And I am bit surrised about taht. Ideally the driver should use the cookie > > to check the status later on... > > looking at other drivers it seems like the drivers should call > dma_submit_error(cookie); on the received cookie - which does: > return cookie < 0 ? cookie : 0; > but doing that after dmaengine_submit() which actually already queued the > this request in shdma_base.cc:shdma_tx_submit() Don't take shdma into account. There's no guarantee that the DMA engine will be an SH DMAC on all platforms where the flctl driver will be used. Furthermore, the shdma implementation might change in the future. You should consider the DMA engine API only and comply with its requirements. > might not be that helpful > and looking at dma_cookie_assign() I do not see how the condition that > dma_submit_error is checking for ever could occur as it can't go below > cookie = DMA_MIN_COOKIE which is defined to 1 (include/linux/dmaengine.h) > > As other drivers seem to not be doing more with the returned cookie than > calling dma_submit_error() on it this seems ok here ...but I'm not that > deep into this - my starting point was a simple API inconsisteny in the > use of wait_for_completion_timeout() :) -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/