From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751125AbdAXMNn (ORCPT ); Tue, 24 Jan 2017 07:13:43 -0500 Received: from wolverine01.qualcomm.com ([199.106.114.254]:34345 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750934AbdAXMNl (ORCPT ); Tue, 24 Jan 2017 07:13:41 -0500 X-IronPort-AV: E=Sophos;i="5.33,278,1477983600"; d="scan'208";a="257782140" X-IronPort-AV: E=McAfee;i="5700,7163,8417"; a="1277855050" From: "Valo, Kalle" To: Joe Perches CC: Srinivas Kandagatla , "ath10k@lists.infradead.org" , "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent() Thread-Topic: [PATCH 2/3] ath10k: use dma_zalloc_coherent() Thread-Index: AQHSdjtHt7yl1n+ARE+PIVca53tcTA== Date: Tue, 24 Jan 2017 12:13:32 +0000 Message-ID: <87r33s8xli.fsf@kamboji.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> <1485235529.12563.39.camel@perches.com> In-Reply-To: <1485235529.12563.39.camel@perches.com> (Joe Perches's message of "Mon, 23 Jan 2017 21:25:29 -0800") Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.251.52.12] Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v0OCE5B3007242 Joe Perches writes: > 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. 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