From patchwork Tue Nov 29 06:59:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9451071 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 CF70460235 for ; Tue, 29 Nov 2016 06:59:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C345027CF9 for ; Tue, 29 Nov 2016 06:59:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B585927E3E; Tue, 29 Nov 2016 06:59:38 +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 A3B3527CF9 for ; Tue, 29 Nov 2016 06:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755997AbcK2G7f (ORCPT ); Tue, 29 Nov 2016 01:59:35 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35287 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755989AbcK2G7e (ORCPT ); Tue, 29 Nov 2016 01:59:34 -0500 Received: by mail-pf0-f193.google.com with SMTP id i88so7746343pfk.2; Mon, 28 Nov 2016 22:59:34 -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=IbnTs9ewy7DxLMy+f9VwOBLv9mzVhwrndl4ytgwKFDE=; b=Ff7nS1szNzTkZMlF5ukapaZLyjBbA0XwdmoQEizRjhYgc7Rg2WWRpEryq4FuKkAn5S GrdhiOPAqumfYsfII5ZSCMLOzXj4Mu/m00UsYY2BwFy9wbCFGDA3yPJb4ZYierG87CoY RO5NsAd4mFCOEiqJNo50xPow1N2lzuwTiv6vnYzCeIISq/GGVEo6lR7m3lSnadXDZgG9 NDU8lbboVWxT9OGgGI+CSH/nd4YpAa8J82PCwEGG4jNdjCh6ajVvKW0y4N7m3GBUWtUw s0RkPxvzbOTCCmHkTxki47m0RvvB7Kio9tVrNDJKOScqFesw+km5+wKPLcCqq5Ope8B0 D8vA== 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=IbnTs9ewy7DxLMy+f9VwOBLv9mzVhwrndl4ytgwKFDE=; b=Fy+OeRwYlL7qI5h4pCrLstrAjPap/fq3Z7E+JTXLrkqEXRazesdG1cCvCfavXOAN2h 5Qf3y9A4h586b5zeUk9Ai4kqtX7+3bkaOr6lgGgkPegphJu5WXW+BruwKnnWriHbrLRB OO7ppS3yfcGMkKtgAjOPSJliW0sR/Ut+B8Ek/aZ20fgdfQ/y14xFNMWCgoamoJPLO+IG grrWzLFC6ZT1q5F4wtNKU/KTjsmJtcN5nmZmrG3jzMRKNMSLQ1XcmlC8f+znRQUWt9Pi /uA273CQ9NhPOQVBGpX1QaeoeLn96npc1XgbvdWxJE4L4h0H9Jj6CnK6cdChEez2ShZb qHPQ== X-Gm-Message-State: AKaTC03iX+Kuq1vq40EIX1MUjUST9Hjm2+mR4t9LQkFSqFomdyfTRQj/GF+B5LFiTa7rCg== X-Received: by 10.99.1.132 with SMTP id 126mr47147740pgb.129.1480402774019; Mon, 28 Nov 2016 22:59:34 -0800 (PST) Received: from gnr743-HP-ZBook-15 ([223.31.70.102]) by smtp.gmail.com with ESMTPSA id f81sm91996488pfd.71.2016.11.28.22.59.32 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Nov 2016 22:59:33 -0800 (PST) Date: Tue, 29 Nov 2016 12:29:31 +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 v2] ethernet :mellanox :mlx4: Replace pci_pool_alloc by pci_pool_zalloc Message-ID: <20161129065931.GA3245@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 mlx4_alloc_cmd_mailbox(), pci_pool_alloc() followed by memset will be replaced by pci_pool_zalloc(). Signed-off-by: Souptick joarder --- v2: - Address comment from sergei Alignment was not proper drivers/net/ethernet/mellanox/mlx4/cmd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index e36bebc..96cdf9a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c @@ -2679,14 +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; }