Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752871AbcD2VCd (ORCPT ); Fri, 29 Apr 2016 17:02:33 -0400 Received: from mail-am1on0059.outbound.protection.outlook.com ([157.56.112.59]:22848 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752329AbcD2VCb convert rfc822-to-8bit (ORCPT ); Fri, 29 Apr 2016 17:02:31 -0400 X-Greylist: delayed 854 seconds by postgrey-1.27 at vger.kernel.org; Fri, 29 Apr 2016 17:02:30 EDT From: Yang-Leo Li To: Julia Lawall , Li Yang CC: "kernel-janitors@vger.kernel.org" , "Zhang Wei" , Vinod Koul , Dan Williams , "linuxppc-dev@lists.ozlabs.org" , "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 5/5] dmaengine: fsldma: Use dma_pool_zalloc Thread-Topic: [PATCH 5/5] dmaengine: fsldma: Use dma_pool_zalloc Thread-Index: AQHRolUpr5ICn6oqnUGOLlqMTdncrp+ha2gg Date: Fri, 29 Apr 2016 20:48:14 +0000 Message-ID: References: <1461960552-7429-1-git-send-email-Julia.Lawall@lip6.fr> <1461960552-7429-6-git-send-email-Julia.Lawall@lip6.fr> In-Reply-To: <1461960552-7429-6-git-send-email-Julia.Lawall@lip6.fr> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lip6.fr; dkim=none (message not signed) header.d=none;lip6.fr; dmarc=none action=none header.from=nxp.com; x-originating-ip: [192.88.168.50] x-ms-office365-filtering-correlation-id: 0d766245-1c36-4b9f-313b-08d3706f95c0 x-microsoft-exchange-diagnostics: 1;AM2PR04MB0770;5:Sv557sQ0Mua6Lmi9oQid8ex43gjjYIfvrrVN+lkMBXHbk5kosgXO6grfsuMk5GSRTIKYOfgXFuhTD1wEn5NYvIqdlcXc/J2jQI8p03Qwob2T2z4d1od+GsfnVjemGl0fmHfI0dIeWaT0iGgXnvGIEA==;24:INayik4FCSyAeS4f0jT2C0Sm6SV7X5fVPBh8TMEw0JnBuOhTIRc7qh44oEoG6A9xQKLWjVO/WbakWpbov224hqPap87gwShG+xK9IpT/LbM=;7:ltTtEC/PRWok+sDroBM3aqaSUtkT144B+5S15n8OEk98pqqMXRtTHit8f0rnY1VpnigG1QXLAH6/Te+A9CzQt8V+o46bWc3dWwOT+VH8jAu9IbNDoqbhFG1NPkjrOqKPql4mA3XhE7w9WIVb4645s7WRM3JGc/hfG4K65hV/Qg9v6ZJMkQS2oZXGFFRQ5zJg x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM2PR04MB0770; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026);SRVR:AM2PR04MB0770;BCL:0;PCL:0;RULEID:;SRVR:AM2PR04MB0770; x-forefront-prvs: 0927AA37C7 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(377454003)(13464003)(86362001)(74316001)(5250100002)(76576001)(66066001)(54356999)(50986999)(2950100001)(2906002)(15975445007)(106116001)(3660700001)(2900100001)(3280700002)(92566002)(9686002)(5003600100002)(76176999)(1096002)(81166005)(1220700001)(102836003)(11100500001)(33656002)(5008740100001)(87936001)(3846002)(5001770100001)(6116002)(586003)(19580395003)(19580405001)(5002640100001)(189998001)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:AM2PR04MB0770;H:AM2PR04MB0770.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2016 20:48:14.3890 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0770 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1764 Lines: 58 > -----Original Message----- > From: Julia Lawall [mailto:Julia.Lawall@lip6.fr] > Sent: Friday, April 29, 2016 3:09 PM > To: Li Yang > Cc: kernel-janitors@vger.kernel.org; Zhang Wei ; Vinod > Koul ; Dan Williams ; > linuxppc-dev@lists.ozlabs.org; dmaengine@vger.kernel.org; linux- > kernel@vger.kernel.org > Subject: [PATCH 5/5] dmaengine: fsldma: Use dma_pool_zalloc > > Dma_pool_zalloc combines dma_pool_alloc and memset 0. The semantic patch > that makes this transformation is as follows: (http://coccinelle.lip6.fr/) > > // > @@ > expression d,e; > statement S; > @@ > > d = > - dma_pool_alloc > + dma_pool_zalloc > (...); > if (!d) S > - memset(d, 0, sizeof(*d)); > // > > Signed-off-by: Julia Lawall Acked-by: Li Yang > > --- > drivers/dma/fsldma.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index > aac85c3..a8828ed 100644 > --- a/drivers/dma/fsldma.c > +++ b/drivers/dma/fsldma.c > @@ -462,13 +462,12 @@ static struct fsl_desc_sw > *fsl_dma_alloc_descriptor(struct fsldma_chan *chan) > struct fsl_desc_sw *desc; > dma_addr_t pdesc; > > - desc = dma_pool_alloc(chan->desc_pool, GFP_ATOMIC, &pdesc); > + desc = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &pdesc); > if (!desc) { > chan_dbg(chan, "out of memory for link descriptor\n"); > return NULL; > } > > - memset(desc, 0, sizeof(*desc)); > INIT_LIST_HEAD(&desc->tx_list); > dma_async_tx_descriptor_init(&desc->async_tx, &chan->common); > desc->async_tx.tx_submit = fsl_dma_tx_submit;