From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750781AbdAXFS4 (ORCPT ); Tue, 24 Jan 2017 00:18:56 -0500 Received: from wolverine02.qualcomm.com ([199.106.114.251]:28258 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750703AbdAXFSy (ORCPT ); Tue, 24 Jan 2017 00:18:54 -0500 X-IronPort-AV: E=Sophos;i="5.33,277,1477983600"; d="scan'208";a="353071115" X-IronPort-AV: E=McAfee;i="5700,7163,8417"; a="1350460314" 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: AQHSdgFYt7yl1n+ARE+PIVca53tcTA== Date: Tue, 24 Jan 2017 05:18:49 +0000 Message-ID: <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> In-Reply-To: <1485213569.12563.32.camel@perches.com> (Joe Perches's message of "Mon, 23 Jan 2017 15:19: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: [199.106.107.6] Content-Type: text/plain; charset="utf-8" Content-ID: <38F78C300A1A754E9111BE621A5D15A6@qualcomm.com> 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 v0O5JDok020717 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. -- Kalle Valo