From patchwork Thu Dec 1 18:41:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9456683 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 02ADE60585 for ; Thu, 1 Dec 2016 18:42:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1990284BD for ; Thu, 1 Dec 2016 18:42:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4E3228527; Thu, 1 Dec 2016 18:42:05 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 73D2E284BD for ; Thu, 1 Dec 2016 18:42:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755856AbcLASmE (ORCPT ); Thu, 1 Dec 2016 13:42:04 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36485 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755498AbcLASmD (ORCPT ); Thu, 1 Dec 2016 13:42:03 -0500 Received: by mail-pg0-f68.google.com with SMTP id x23so5360140pgx.3 for ; Thu, 01 Dec 2016 10:42:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=itDyJdEFg1s0FrrAP6eXbRONueOB94+nZ2+kY9YQiFI=; b=gOieZ2JKohdnCu9NO8lLRhjtmcpisz7po68druU+fLd116kpDNOH69knbEAlD4MpPf CzXUaNjogWeIUxHMoy4w7172Zes2n9VDXDeyhpBd8wwFn95z0CSHqaVFDMSkaSCXMg9p syXbDHdB17wCe274/FPsex/872rLZOOzaFV9J4MaIYEVxACusZXf3hc9GMP6PPu0L1V8 XOrVUUF2OD4rFtriBKKKjfQ4m0BV0jTl8DFTGqQ1se1mMtcjCrq9VtSmJZZgiMdU4zed a2Z8UYRVxkfftDCE4625eWSPEeXHK+a7rLrrAoJo9CCxRfjtQj78G19TAu/lxWDjt/K0 fr8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=itDyJdEFg1s0FrrAP6eXbRONueOB94+nZ2+kY9YQiFI=; b=ar9FSXhCXznyc2CgAeL6pIoWezqfuxElrjWcZjeBdGgQHt+wMJXMgJDURrSOy6c5nK K/zaTHaHM+4pLqjBjRz62CRb6FTVk7XB5OK4K+qwvrBD45U2mB9Sie4uDMKSkrNROud1 vEQlm3v3ObRUM7Q/7ODEXKa1l/eJ4reJ1nqMWMQx/qpdl5l8vXWpw8xo8UGl+2jxosFX S5TVQ6FwlUBAjfUJ+IZD50aWNyzlhiqvN2u4bubXt0WVvChfDdCeHyksLTlylPNMLs2c 77+tH1BeHI33GCSxuVRRPl4/OfFSFzLMaR4vdsQVx08SHfLup9XVEBL8M8D4HJX4Sy1s zMgg== X-Gm-Message-State: AKaTC02lo+73E1n9zCsyhH8uKOYaNJPMYkqWEBcXh4Zx+RDfaNy9qMmh7/f1LjfqYSIESw== X-Received: by 10.84.217.216 with SMTP id d24mr87635556plj.10.1480617722918; Thu, 01 Dec 2016 10:42:02 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([106.51.142.83]) by smtp.gmail.com with ESMTPSA id 1sm1961806pgp.1.2016.12.01.10.42.02 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Dec 2016 10:42:02 -0800 (PST) Date: Fri, 2 Dec 2016 00:11:59 +0530 From: Souptick Joarder To: yuval.shaia@oracle.com, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com Cc: linux-rdma@vger.kernel.org, sahu.rameshwar73@gmail.com Subject: [PATCH v2] infiniband: mthca: Replace pci_pool_alloc by pci_pool_zalloc Message-ID: <20161201184159.GA2949@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 In mthca_create_ah(), pci_pool_alloc() followed by memset will be replaced by pci_pool_zalloc() Signed-off-by: Souptick joarder Reviewed-by: Yuval Shaia --- v2: - Alignment changes - Remove empty lines drivers/infiniband/hw/mthca/mthca_av.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 1.9.1 -- 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 diff --git a/drivers/infiniband/hw/mthca/mthca_av.c b/drivers/infiniband/hw/mthca/mthca_av.c index bcac294..c9f0f36 100644 --- a/drivers/infiniband/hw/mthca/mthca_av.c +++ b/drivers/infiniband/hw/mthca/mthca_av.c @@ -186,8 +186,8 @@ int mthca_create_ah(struct mthca_dev *dev, on_hca_fail: if (ah->type == MTHCA_AH_PCI_POOL) { - ah->av = pci_pool_alloc(dev->av_table.pool, - GFP_ATOMIC, &ah->avdma); + ah->av = pci_pool_zalloc(dev->av_table.pool, + GFP_ATOMIC, &ah->avdma); if (!ah->av) return -ENOMEM; @@ -196,8 +196,6 @@ int mthca_create_ah(struct mthca_dev *dev, ah->key = pd->ntmr.ibmr.lkey; - memset(av, 0, MTHCA_AV_SIZE); - av->port_pd = cpu_to_be32(pd->pd_num | (ah_attr->port_num << 24)); av->g_slid = ah_attr->src_path_bits; av->dlid = cpu_to_be16(ah_attr->dlid);