Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750980AbdLaNJt (ORCPT ); Sun, 31 Dec 2017 08:09:49 -0500 Received: from mail-bl2nam02on0082.outbound.protection.outlook.com ([104.47.38.82]:3103 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750910AbdLaNJr (ORCPT ); Sun, 31 Dec 2017 08:09:47 -0500 From: "Amrani, Ram" To: Himanshu Jha , "dledford@redhat.com" CC: "Kalderon, Michal" , "Elior, Ariel" , "jgg@ziepe.ca" , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] RDMA/qedr: Use zeroing memory allocator than allocator/memset Thread-Topic: [PATCH] RDMA/qedr: Use zeroing memory allocator than allocator/memset Thread-Index: AQHTgjNCw0n5zJB/UkKpsPZ2S9C18aNdbLZg Date: Sun, 31 Dec 2017 13:09:42 +0000 Message-ID: References: <1514723463-5859-1-git-send-email-himanshujha199640@gmail.com> In-Reply-To: <1514723463-5859-1-git-send-email-himanshujha199640@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ram.Amrani@cavium.com; x-originating-ip: [31.168.140.228] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM2PR0701MB1341;7:iOw3VrnJWVWqmvL6LsVb1Vi8FXqs3dMBAQHf36qehH31kySHCPBV7s1DSe1ThyCZLsEXIByr5q4JSHtcuAQG43+vi6KSoydxF7r7SCeCTfX4K6/pSBjFLwur89AboBQuEsWmaZAphYEzfbjeI/VPIn/HFsK4lI5UYTm4hILReG8RvISGKUGzKVGXfn3/Cjrobn46ub58Ufsw8G26Zig4Xu1GhwVbV5k1rNG7CZAXKp3kq/hiB6KaRv+W8/gItwrr x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10009020)(366004)(346002)(39380400002)(39850400004)(396003)(376002)(199004)(189003)(7696005)(76176011)(55016002)(4326008)(68736007)(53936002)(25786009)(5660300001)(3846002)(2900100001)(2501003)(6506007)(229853002)(3660700001)(77096006)(6116002)(9686003)(2906002)(97736004)(99286004)(6436002)(102836004)(3280700002)(74316002)(305945005)(478600001)(7736002)(106356001)(2950100002)(105586002)(316002)(86362001)(6246003)(39060400002)(81166006)(66066001)(54906003)(14454004)(8936002)(33656002)(81156014)(110136005)(8676002)(72206003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0701MB1341;H:BN3PR07MB2578.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-ms-office365-filtering-correlation-id: 0e9d536f-ff64-4e5b-faee-08d5504fc1a2 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060);SRVR:DM2PR0701MB1341; x-ms-traffictypediagnostic: DM2PR0701MB1341: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(944501075)(10201501046)(3002001)(6041268)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011);SRVR:DM2PR0701MB1341;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM2PR0701MB1341; x-forefront-prvs: 0538A71254 x-microsoft-antispam-message-info: RgO8t4ArJuGQpJLHdgBOurawXC22pdQumyBRUeJoKDkxNuMBYognpnYUqKDBBwvVwq67Wzhlzym3MkHnpAV1rQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e9d536f-ff64-4e5b-faee-08d5504fc1a2 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Dec 2017 13:09:42.2240 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0701MB1341 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 quoted-printable to 8bit by mail.home.local id vBVDAIeJ017112 Content-Length: 1195 Lines: 40 > Use dma_zalloc_coherent for allocating zeroed > memory and remove unnecessary memset function. > > Done using Coccinelle. > Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci > 0-day tested with no failures. > > Suggested-by: Luis R. Rodriguez > Signed-off-by: Himanshu Jha > --- > drivers/infiniband/hw/qedr/verbs.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c > index b26aa88..3b9c898 100644 > --- a/drivers/infiniband/hw/qedr/verbs.c > +++ b/drivers/infiniband/hw/qedr/verbs.c > @@ -604,12 +604,11 @@ static struct qedr_pbl *qedr_alloc_pbl_tbl(struct qedr_dev *dev, > return ERR_PTR(-ENOMEM); > > for (i = 0; i < pbl_info->num_pbls; i++) { > - va = dma_alloc_coherent(&pdev->dev, pbl_info->pbl_size, > - &pa, flags); > + va = dma_zalloc_coherent(&pdev->dev, pbl_info->pbl_size, > + &pa, flags); > if (!va) > goto err; > > - memset(va, 0, pbl_info->pbl_size); > pbl_table[i].va = va; > pbl_table[i].pa = pa; > } > -- > 2.7.4 Acked-by: Ram Amrani Thanks, Ram