From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750781AbdAXFZf (ORCPT ); Tue, 24 Jan 2017 00:25:35 -0500 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 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3872:3874:4321:4605:5007:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12114:12438:12740:12895:13069:13311:13357:13439:13894:14181:14659:14721:21080:30003:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: soup31_4d36415ec7f25 X-Filterd-Recvd-Size: 2427 Message-ID: <1485235529.12563.39.camel@perches.com> 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" X-Mailer: Evolution 3.22.3-0ubuntu0.1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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/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.