From patchwork Mon Nov 28 13:37:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9449537 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 ADFD760756 for ; Mon, 28 Nov 2016 13:37:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 998ED266F3 for ; Mon, 28 Nov 2016 13:37:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E30B27D0C; Mon, 28 Nov 2016 13:37:53 +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 0C29827CEA for ; Mon, 28 Nov 2016 13:37:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932830AbcK1Nhr (ORCPT ); Mon, 28 Nov 2016 08:37:47 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35188 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932765AbcK1Nho (ORCPT ); Mon, 28 Nov 2016 08:37:44 -0500 Received: by mail-pg0-f66.google.com with SMTP id p66so13205764pga.2; Mon, 28 Nov 2016 05:37:44 -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=/iZC8gMTB8mNNWBiqFR87qdgK6lIH9UZV0rEB9x+W5M=; b=HMYfxESoKQVJvqeHgs+4z2ufRPDWm2nlnrlRERY1kRvIuyKLo/6CKLL9/qH2vchL25 EtsgCm4apH/asE/LWJaMJlUAHyWncX5OnIsMgD8t736NBA42Fr/DRj8gAa8CG3O0pAIk DhlD6S8PSgw5LDnYiO3M+6fMhvMrBKfJczZspHJFVJd/11AbxwzsyhtXvSzJ97zJO2VV p3ZYoVjMV37Fc4BVWkv0vSFLh17jm5nBuNy7HKV5aVnBK3tJoQ0LFxfSWTofdN23FYs7 3ZlShEDETcuJilHdEBUbUfhV32WiV1maN5CxYTSJwzL8zF7bem2YfmDHWnsmfOECi1Zb p3SQ== 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=/iZC8gMTB8mNNWBiqFR87qdgK6lIH9UZV0rEB9x+W5M=; b=f6ROumOU4nEk22b0D9Kihy9HTUUfNJc4tAhsAYi7Vmm6w3BQ9H0csP05+cvi2Tnk8i XsB+vPyHphgTteLF4wSjuNAu/E2hkg9Kp7wyBTusWYQ+PC7vGA5DcibzhXeoT+uYxvXG stsUhWXtu1fwTGayCimESkGKrDhoIfNPKVQi74wF0y81AzQAfl9cnOnjRsJVseK5pGpa i5lYUOz+f9i6eR/8RrQH5LqTHSOIkQ6AOlqK44R8S71/eHIYlDNTyaOEmAEqaRQ9Z+/1 3uRrk46NGD6/zBheXPBuKSwNHFnxa4tAoBdDdGCmw9iHV0dl97EGhsbSqIPQs94Z2qKb Ii3g== X-Gm-Message-State: AKaTC03DzdtNIPg8oOiHkwrUmV3iWMpcOUAIaEBbkRtzlmPDS4vHu2WbVSWlRGDQREMckQ== X-Received: by 10.98.70.150 with SMTP id o22mr21950741pfi.134.1480340263251; Mon, 28 Nov 2016 05:37:43 -0800 (PST) Received: from gnr743-HP-ZBook-15 ([223.31.70.102]) by smtp.gmail.com with ESMTPSA id 1sm60115178pgp.1.2016.11.28.05.37.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Nov 2016 05:37:42 -0800 (PST) Date: Mon, 28 Nov 2016 19:07:40 +0530 From: Souptick Joarder To: saeedm@mellanox.com, matanb@mellanox.com, leonro@mellanox.com Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, sahu.rameshwar73@gmail.com Subject: [PATCH] ethernet :mellanox :mlx5: Replace pci_pool_alloc by pci_pool_zalloc Message-ID: <20161128133740.GA688@gnr743-HP-ZBook-15> 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 alloc_cmd_box(), pci_pool_alloc() followed by memset will be replaced by pci_pool_zalloc() Signed-off-by: Souptick joarder --- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 1e639f8..d96ebd4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c @@ -1063,14 +1063,13 @@ static struct mlx5_cmd_mailbox *alloc_cmd_box(struct mlx5_core_dev *dev, if (!mailbox) return ERR_PTR(-ENOMEM); - mailbox->buf = pci_pool_alloc(dev->cmd.pool, flags, + mailbox->buf = pci_pool_zalloc(dev->cmd.pool, flags, &mailbox->dma); if (!mailbox->buf) { mlx5_core_dbg(dev, "failed allocation\n"); kfree(mailbox); return ERR_PTR(-ENOMEM); } - memset(mailbox->buf, 0, sizeof(struct mlx5_cmd_prot_block)); mailbox->next = NULL; return mailbox;