From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtprelay0136.hostedemail.com ([216.40.44.136]:38124 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750703AbdAXFZd (ORCPT ); Tue, 24 Jan 2017 00:25:33 -0500 Message-ID: <1485235529.12563.39.camel@perches.com> (sfid-20170124_062553_643161_B3396CF0) Subject: Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent() From: Joe Perches To: "Valo, Kalle" Cc: Srinivas Kandagatla , "ath10k@lists.infradead.org" , "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Date: Mon, 23 Jan 2017 21:25:29 -0800 In-Reply-To: <8737g9ox1k.fsf@qca.qualcomm.com> References: <1485183876-27080-1-git-send-email-srinivas.kandagatla@linaro.org> <1485183876-27080-2-git-send-email-srinivas.kandagatla@linaro.org> <1485213569.12563.32.camel@perches.com> <8737g9ox1k.fsf@qca.qualcomm.com> Content-Type: text/plain; charset="ISO-8859-1" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Tue, 2017-01-24 at 05:18 +0000, Valo, Kalle wrote: > Joe Perches writes: > > > On Mon, 2017-01-23 at 15:04 +0000, Srinivas Kandagatla wrote: > > > use dma_zalloc_coherent() instead of dma_alloc_coherent and memset(). > > > > [] > > > diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c > > > > [] > > > @@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data, > > > */ > > > alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT); > > > > > > - data_buf = (unsigned char *)dma_alloc_coherent(ar->dev, > > > + data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev, > > > alloc_nbytes, > > > &ce_data_base, > > > GFP_ATOMIC); > > > > trivia: > > > > Nicer to realign arguments and remove the unnecessary cast. > > > > Perhaps: > > > > data_buf = dma_zalloc_coherent(ar->dev, alloc_nbytes, &ce_data_base, > >  GFP_ATOMIC); > > Sure, but that should be in a separate patch. I don't think so, trivial patches can be combined. It's also nicer to realign all modified multiline arguments when performing these changes. Coccinelle generally does it automatically. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtprelay0117.hostedemail.com ([216.40.44.117] helo=smtprelay.hostedemail.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cVtcD-0005Kn-G1 for ath10k@lists.infradead.org; Tue, 24 Jan 2017 05:25:59 +0000 Message-ID: <1485235529.12563.39.camel@perches.com> Subject: Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent() From: Joe Perches Date: Mon, 23 Jan 2017 21:25:29 -0800 In-Reply-To: <8737g9ox1k.fsf@qca.qualcomm.com> References: <1485183876-27080-1-git-send-email-srinivas.kandagatla@linaro.org> <1485183876-27080-2-git-send-email-srinivas.kandagatla@linaro.org> <1485213569.12563.32.camel@perches.com> <8737g9ox1k.fsf@qca.qualcomm.com> Mime-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: "Valo, Kalle" Cc: "linux-wireless@vger.kernel.org" , Srinivas Kandagatla , "linux-kernel@vger.kernel.org" , "ath10k@lists.infradead.org" , "netdev@vger.kernel.org" On Tue, 2017-01-24 at 05:18 +0000, Valo, Kalle wrote: > Joe Perches writes: > = > > On Mon, 2017-01-23 at 15:04 +0000, Srinivas Kandagatla wrote: > > > use dma_zalloc_coherent() instead of dma_alloc_coherent and memset(). > > = > > [] > > > diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wire= less/ath/ath10k/pci.c > > = > > [] > > > @@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k= *ar, u32 address, void *data, > > > */ > > > alloc_nbytes =3D min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT); > > > = > > > - data_buf =3D (unsigned char *)dma_alloc_coherent(ar->dev, > > > + data_buf =3D (unsigned char *)dma_zalloc_coherent(ar->dev, > > > alloc_nbytes, > > > &ce_data_base, > > > GFP_ATOMIC); > > = > > trivia: > > = > > Nicer to realign arguments and remove the unnecessary cast. > > = > > Perhaps: > > = > > data_buf =3D dma_zalloc_coherent(ar->dev,=A0alloc_nbytes, &ce_data_bas= e, > > =A0GFP_ATOMIC); > = > Sure, but that should be in a separate patch. I don't think so, trivial patches can be combined. It's also nicer to realign all modified multiline arguments when performing these changes. Coccinelle generally does it automatically. _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k