Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3587977imm; Mon, 4 Jun 2018 06:13:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIsFckfwhzGkvC9wPjrJOaf+DB5eGfCAhB1Ob1UyTAnVoIoTDkGEE0KXi/eqLV4wzgHv6w1 X-Received: by 2002:a17:902:8210:: with SMTP id x16-v6mr2058278pln.307.1528118012683; Mon, 04 Jun 2018 06:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528118012; cv=none; d=google.com; s=arc-20160816; b=TB7j9dohiYzTyewGMdLQjZIsTfScy7U8B9nV+RtaULeUcNMPTcNMUD2flOyGncV2Ej l8ZvfPLou6Q15gsYfd9AilQhXdqE21XCTr2TDZ+1PaOCx3UEyxiGNeNxaYzB3kDJ9H47 U9f34MXsX3CkzGz7RegXNhVhN57fQC1mIFyl/8+CcYOBm0Hhq/o3K2gquqNKV8whQs9S W/PFyS9dGZAba8uQs/yECAvNWrdZs4sMqc6dcFvV3OxOlT83JraHj+92qvdkaTy3f2Dc vaDx7MmmSpjwIffiT95vj7/ANbhutwrF6dyxnnoS92EUHd49fFK/iNCbGthKa7/KLIFx yaKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=vCUCTW7z7sRavvMGzk6JeUqa2X1FFfy0LKxdQcPhh/w=; b=otB9TCOT3R+qJ8ZW/Cds0tZRgPGL1F+fujAQdPQjD5OrxdwGPoLKRKv6AG8A7Syi+2 xy/EU75uze/kouAotxL6Q64P1xu5u0j//BilaTR/gLmrFeyxKtLDib5hHZXlJTPcUmOK PXYiqzd84PkFRPLAMR0mQlFWom0JQl8WY7/Me9HZNwVIuZ58Z4Xph5dtNLTvMdMlpjU6 qHvmNKLjjBCCra0NcEp+jLDkDdy6JqRMk1o3PpVxppU1S7FS7MDtIFOM0ovs/0nmk6BQ D/okGnFdTAcnBV5x8jAyEZ9+uk8zbdVmCh5ffIFV2yywyI+VQZXCuOY4F0s0qyoQRXNv ZdXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v14-v6si5102919pfe.149.2018.06.04.06.13.18; Mon, 04 Jun 2018 06:13:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753256AbeFDNLE (ORCPT + 99 others); Mon, 4 Jun 2018 09:11:04 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8635 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753001AbeFDNLD (ORCPT ); Mon, 4 Jun 2018 09:11:03 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 52698A1A28DEF; Mon, 4 Jun 2018 21:10:49 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.382.0; Mon, 4 Jun 2018 21:10:43 +0800 From: YueHaibing To: , CC: , , , YueHaibing Subject: [PATCH net-next] qed: use dma_zalloc_coherent instead of allocator/memset Date: Mon, 4 Jun 2018 21:10:31 +0800 Message-ID: <20180604131031.24476-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. Signed-off-by: YueHaibing --- drivers/net/ethernet/qlogic/qed/qed_cxt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c index 820b226..1835f00 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c +++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c @@ -936,14 +936,13 @@ static int qed_cxt_src_t2_alloc(struct qed_hwfn *p_hwfn) u32 size = min_t(u32, total_size, psz); void **p_virt = &p_mngr->t2[i].p_virt; - *p_virt = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, - size, - &p_mngr->t2[i].p_phys, GFP_KERNEL); + *p_virt = dma_zalloc_coherent(&p_hwfn->cdev->pdev->dev, + size, &p_mngr->t2[i].p_phys, + GFP_KERNEL); if (!p_mngr->t2[i].p_virt) { rc = -ENOMEM; goto t2_fail; } - memset(*p_virt, 0, size); p_mngr->t2[i].size = size; total_size -= size; } -- 2.7.0