From patchwork Mon Mar 19 11:11:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 10292151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0DC42600F6 for ; Mon, 19 Mar 2018 11:12:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF5F02920A for ; Mon, 19 Mar 2018 11:12:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2D052920F; Mon, 19 Mar 2018 11:12:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B8C62919C for ; Mon, 19 Mar 2018 11:12:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933069AbeCSLMC (ORCPT ); Mon, 19 Mar 2018 07:12:02 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:39866 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932487AbeCSLMB (ORCPT ); Mon, 19 Mar 2018 07:12:01 -0400 X-IronPort-AV: E=Sophos;i="5.48,330,1517871600"; d="scan'208";a="318781938" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2018 12:12:00 +0100 Date: Mon, 19 Mar 2018 12:11:55 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Raju Rangoju cc: dledford@redhat.com, linux-rdma@vger.kernel.org, swise@opengridcomputing.com, rajur@chelsio.com, kbuild-all@01.org Subject: [PATCH] rdma/cxgb4: fix zalloc-simple.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fengguang Wu Use zeroing allocator rather than allocator followed by memset with 0 Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci CC: Raju Rangoju Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- url: https://github.com/0day-ci/linux/commits/Raju-Rangoju/rdma-cxgb4-Add-SRQ-support-for-Chelsio-adapters/20180313-062514 :::::: branch date: 7 days ago :::::: commit date: 7 days ago qp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/infiniband/hw/cxgb4/qp.c +++ b/drivers/infiniband/hw/cxgb4/qp.c @@ -2377,13 +2377,11 @@ static int alloc_srq_queue(struct c4iw_s wq->rqt_abs_idx = (wq->rqt_hwaddr - rdev->lldi.vr->rq.start) >> T4_RQT_ENTRY_SHIFT; - wq->queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev), - wq->memsize, &(wq->dma_addr), - GFP_KERNEL); + wq->queue = dma_zalloc_coherent(&(rdev->lldi.pdev->dev), wq->memsize, + &(wq->dma_addr), GFP_KERNEL); if (!wq->queue) goto err_free_rqtpool; - memset(wq->queue, 0, wq->memsize); pci_unmap_addr_set(wq, mapping, wq->dma_addr); wq->bar2_va = c4iw_bar2_addrs(rdev, wq->qid, T4_BAR2_QTYPE_EGRESS,