From patchwork Tue Nov 29 21:20:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9453133 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 A99E060235 for ; Tue, 29 Nov 2016 21:20:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D5902838D for ; Tue, 29 Nov 2016 21:20:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F13F28391; Tue, 29 Nov 2016 21:20:24 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 19B9F28391 for ; Tue, 29 Nov 2016 21:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755011AbcK2VUW (ORCPT ); Tue, 29 Nov 2016 16:20:22 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34378 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754882AbcK2VUV (ORCPT ); Tue, 29 Nov 2016 16:20:21 -0500 Received: by mail-pg0-f68.google.com with SMTP id e9so17421820pgc.1; Tue, 29 Nov 2016 13:20:21 -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=Shgh3hO1cyxwemAygPMsG4YvskIf9N+tPJqdv0tD4Ow=; b=izWM3N6UABJI8DvJIqJgzX6zj9K8ffathXm0LvJvbiqtTrM0rfCbqa0mWa9p9tLZvb HYU/8w1XlI7GkyOyNRXbUNZMUWU8Er7eJHDPjT3f9Dg0MykL/aru/L9b68sPDnkbsLTu HF6gEIpe33FrzZj1nyJ8AiL6EyIYaloR2L+giYnSZ6A9NVWQnYTbPFsxKWSkX9f8xAm+ Xb9Vbq1Z42nMBZQyTzXg7B6YHiHATf2j1DNPdV9OKqRxJ5OVEqalerLTyed4rzKeE5is KAxlmnmzSeLqvII5zb7Yl2Y8Za4usCK9AMv4bTbagOiRSyaiqUMa1fIrwfX0CyjM9XtV URpg== 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=Shgh3hO1cyxwemAygPMsG4YvskIf9N+tPJqdv0tD4Ow=; b=Tbl3WhW52UWjL2NRyElwasMpf8YgKIimVcdTBz//r9sE1O+IMdg4316g+3v01pkvhr CIodgMTwS95Tc6ZUq93HNmVRNkMzJgECT7VCGe9Aj0VbHsQNQ96m/eAZt01v2jMrAhCO 82i+otMlxPXdYWIdVuIbc9SGcq1As3Q85uHshfije7tlWai0nD/fkQb44sv0eBz8Esck VY3CmUi84AXaoM1mdEp8hRy5ct6NOB1nXX0hfsCTSZ8MEQMrIl23Ta+u8VLw32Aang9o PZjdshr48tO2rZFJPOJ8ZHHmnTpSMhGcVjcBla4/H/J9zUE+3AfU1hvQlZ2rkd4wP/HN urgw== X-Gm-Message-State: AKaTC033Dp6xctcQoH0qgRUnllPim5pqXB6/3SlUQ6TqidQBC+BoWmaPHaYj1y0rMxWGyQ== X-Received: by 10.99.24.84 with SMTP id 20mr53785785pgy.12.1480454421162; Tue, 29 Nov 2016 13:20:21 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([106.51.142.83]) by smtp.gmail.com with ESMTPSA id c8sm97282516pfe.15.2016.11.29.13.20.20 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Nov 2016 13:20:20 -0800 (PST) Date: Wed, 30 Nov 2016 02:50:18 +0530 From: Souptick Joarder To: sergei.shtylyov@cogentembedded.com, 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 v2] ethernet :mellanox :mlx5: Replace pci_pool_alloc by pci_pool_zalloc Message-ID: <20161129212018.GA5419@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 alloc_cmd_box(), pci_pool_alloc() followed by memset will be replaced by pci_pool_zalloc() Signed-off-by: Souptick joarder --- v2: - Address comments from Sergei Alignment was not proper drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 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/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 1e639f8..94a23f6 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->dma); + 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;