Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565811

Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()

From "Valo, Kalle" <kvalo@qca.qualcomm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()
Date 2017-01-24 13:20 +0100
Message-ID <t38eR-4bB-17@gated-at.bofh.it> (permalink)
References <t2OpQ-812-9@gated-at.bofh.it> <t2OpR-812-51@gated-at.bofh.it> <t2W41-4w8-15@gated-at.bofh.it> <t31Gq-8u2-7@gated-at.bofh.it> <t31Q5-8D-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Joe Perches <joe@perches.com> writes:

> On Tue, 2017-01-24 at 05:18 +0000, Valo, Kalle wrote:
>> Joe Perches <joe@perches.com> 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.

A matter of preference really. I prefer keeping style and functional
changes in separate patches, keeps the review simple. And style changes
can hide bugs.

-- 
Kalle Valo

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2017-01-23 16:10 +0100
  [PATCH 3/3] ath10k: fix typo in addr calculation Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2017-01-23 16:10 +0100
  [PATCH 2/3] ath10k: use dma_zalloc_coherent() Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2017-01-23 16:10 +0100
    Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent() Joe Perches <joe@perches.com> - 2017-01-24 00:20 +0100
      Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent() "Valo, Kalle" <kvalo@qca.qualcomm.com> - 2017-01-24 06:20 +0100
        Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent() Joe Perches <joe@perches.com> - 2017-01-24 06:30 +0100
          Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent() "Valo, Kalle" <kvalo@qca.qualcomm.com> - 2017-01-24 13:20 +0100
  Re: [1/3] ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT Kalle Valo <kvalo@qca.qualcomm.com> - 2017-01-27 19:20 +0100

csiph-web