Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756077AbcKKMVD (ORCPT ); Fri, 11 Nov 2016 07:21:03 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:60886 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752013AbcKKMVB (ORCPT ); Fri, 11 Nov 2016 07:21:01 -0500 Date: Fri, 11 Nov 2016 12:20:36 +0000 From: Mark Brown To: Sanchayan Maity Cc: stefan@agner.ch, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Message-ID: <20161111122036.fubv7b4jc5vkdxhc@sirena.org.uk> References: <836dd6a84fa149cafdbb0b53e792d305febf6207.1478778329.git.maitysanchayan@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="edmsioyepdlvabem" Content-Disposition: inline In-Reply-To: <836dd6a84fa149cafdbb0b53e792d305febf6207.1478778329.git.maitysanchayan@gmail.com> X-Cookie: Apply only to affected area. User-Agent: NeoMutt/20161104 (1.7.1) X-SA-Exim-Connect-IP: 94.197.121.77 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH v3] spi: spi-fsl-dspi: Add DMA support for Vybrid X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1384 Lines: 41 --edmsioyepdlvabem Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 10, 2016 at 05:49:15PM +0530, Sanchayan Maity wrote: A couple of small things, please send followup patches fixing them. > + rx_word = is_double_byte_mode(dspi); > + > + len = rx_word ? (dma->curr_xfer_len / 2) : dma->curr_xfer_len; Please use normal if statements, they're much easier to read. > +err_slave_config: > + devm_kfree(dev, dma->rx_dma_buf); > +err_rx_dma_buf: > + devm_kfree(dev, dma->tx_dma_buf); You really shouldn't need to explicitly free things like this if you're using devm_, especially in the error path from the probe function like this where a failure is just going to result in the device failing to instantiate so you won't have the allocation sitting around unused for any length of time. --edmsioyepdlvabem Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAABCAAGBQJYJbeTAAoJECTWi3JdVIfQBOoH/R20WLl5Pg8qVocL8dDkgL68 BmJca8Xs7jyECuV4vdHDg0n7Uk05vgqn/oo4FfBiaZ2SvELY8vZ2y4adQvHkbgX2 JJ9Hi+dmvz/aTihIAx1uw6MU8xl4Xz1X1ufr+XvA7aTDc0XGx1NlLNukslnQr6VA uj3hRcnlDnPYS8fnLkTjkUzotJhJS6PjzVhuNKgs8zzw/CK+d4PFgTkvkqKEikML X/iw+szR17Z4h8AL3JaVvQyeWtBl99CylnwEK7EnCz3+n88dxSWnj2vT3cenwZvG S+l5U7VBcj4KKNzJPt9z5eecf8/Jx5Z7/x8Tg7cNkaio4BH7SXkkZ1QjjCEsD4c= =R3SX -----END PGP SIGNATURE----- --edmsioyepdlvabem--