From patchwork Tue Nov 29 19:46:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9453063 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 9A94D60710 for ; Tue, 29 Nov 2016 19:46:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8013E2835D for ; Tue, 29 Nov 2016 19:46:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7463128387; Tue, 29 Nov 2016 19:46:20 +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 164DF2835D for ; Tue, 29 Nov 2016 19:46:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752771AbcK2TqR (ORCPT ); Tue, 29 Nov 2016 14:46:17 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34252 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751726AbcK2TqQ (ORCPT ); Tue, 29 Nov 2016 14:46:16 -0500 Received: by mail-pg0-f68.google.com with SMTP id e9so17226354pgc.1; Tue, 29 Nov 2016 11:46:16 -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=ZG3SX9f4g+H1TWVM/c4hckQ4IeXajE7Rnny8eP/dFxs=; b=0oOyzCi6q8mP6Li0wainKMHFMRjjxRhCYysPMsSrPNhtRCXSVp9WO2NkM0AfZMdhzM XqScAxG+a0cYhtBD+XhRHjSZ5uaQPsXsfH+dfW1LcKWudWiG/NzQp+n2JWl4Vv2QtExm htoA3Z76Nu6xNj1OslQFCLMDX28Uuw85dlGsYR9EQR6UuMXGIjPW8+gx+rCzaMRNL6Wr kq41P5/qEMcrElnNRhLXHhmdovLyhwsZrpNrosr45A0EZl/TyP2dCXHMNv5xiUEdBbCr jlFsFFB5uc3u8ssJMUmXVOJB/DNbeiC0d5Xq6tC36GZEZo1za2nMvYHQKmfUpHXmeJi8 DR4w== 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=ZG3SX9f4g+H1TWVM/c4hckQ4IeXajE7Rnny8eP/dFxs=; b=YyZDnVysPWxQ3rCAbyrqTM6OS/bQ3lm+z7HCILID7t8GckXbC6sA/kFmKJjgLvM9To 1X/NVqNcpQ2UBfoKvAz9w7zA2pjdtZiuuM0AVBq65x48XQnmWioiIzhGS5XoVpri1owU 1mvaB4zIUlx2oMb6isgtkeD3jjjXYmP8w4e9o2hPexpul0to5o9u3qzfU9U44aXqrVT6 HkrDsr1nbQ43PIJbL8j+JNC9BgDPlmcYlges/9cFJsbowLNgQYCYBhJImY930h3KXWmj 81rLqN9EAH0GoE4wlz+ILbjVi2mlZxkueU05IUs8eg+lsOOkuu8iiCfz0QYkTd3TJ3zq bKxA== X-Gm-Message-State: AKaTC02laPFQHKAcGV/79IkuBtqpZ4zTUh0QGlaAK0KZQChcqx/OFXxEiS3Sn2Pp25lXeQ== X-Received: by 10.99.234.21 with SMTP id c21mr53433428pgi.166.1480448775758; Tue, 29 Nov 2016 11:46:15 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([106.51.142.83]) by smtp.gmail.com with ESMTPSA id c128sm97020103pfc.39.2016.11.29.11.46.13 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Nov 2016 11:46:14 -0800 (PST) Date: Wed, 30 Nov 2016 01:16:12 +0530 From: Souptick Joarder To: sergei.shtylyov@cogentembedded.com, yishaih@mellanox.com Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, sahu.rameshwar73@gmail.com Subject: [PATCH v3] ethernet :mellanox :mlx4: Replace pci_pool_alloc by pci_pool_zalloc Message-ID: <20161129194611.GA4088@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 mlx4_alloc_cmd_mailbox(), pci_pool_alloc() followed by memset will be replaced by pci_pool_zalloc() Signed-off-by: Souptick joarder Reviewed-by: Yuval Shaia Reviewed-by: Tariq Toukan --- v3: - Fixed alignment issues v2: - Address comment from sergei Alignment was not proper drivers/net/ethernet/mellanox/mlx4/cmd.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/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index e36bebc..a49072b4 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c @@ -2679,15 +2679,13 @@ struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev) if (!mailbox) return ERR_PTR(-ENOMEM); - mailbox->buf = pci_pool_alloc(mlx4_priv(dev)->cmd.pool, GFP_KERNEL, - &mailbox->dma); + mailbox->buf = pci_pool_zalloc(mlx4_priv(dev)->cmd.pool, GFP_KERNEL, + &mailbox->dma); if (!mailbox->buf) { kfree(mailbox); return ERR_PTR(-ENOMEM); } - memset(mailbox->buf, 0, MLX4_MAILBOX_SIZE); - return mailbox; } EXPORT_SYMBOL_GPL(mlx4_alloc_cmd_mailbox);