From patchwork Wed Feb 14 19:00:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10219749 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 79E9F60467 for ; Wed, 14 Feb 2018 18:59:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7830228A47 for ; Wed, 14 Feb 2018 18:59:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C9ED29050; Wed, 14 Feb 2018 18:59:07 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 1100829038 for ; Wed, 14 Feb 2018 18:59:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162462AbeBNS7F (ORCPT ); Wed, 14 Feb 2018 13:59:05 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:37289 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162210AbeBNS7E (ORCPT ); Wed, 14 Feb 2018 13:59:04 -0500 Received: by mail-pl0-f67.google.com with SMTP id ay8so9041738plb.4 for ; Wed, 14 Feb 2018 10:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=1HAuIOhFlqhBwqi1CXEPVi75rumM2h3RcT/A965fhMQ=; b=XRpEzQzw5h9pZ679KksHOwZuIL7CckMeO1Q1pYOhF5tZ9cPWDd4Kx6QPcYsw2SfKDK 2zbh1VxNguTXzZmfBGzvLCp9aDypWnNRG91byUmJGIcmhZo9jPCTNS6OaM6lj/kSrWP8 Z7CnJxKbLepGZAAuLTL3HzbomyNJkzxWdPpPAk/9DJAc52r73dFfpVmuWfN8Tkpe0TZE usjpxk67Q14RTeiQsuWjnGLVq7x/2dHN18wUXxCBHx8FDJArDJkNIoTHIzECwraxQ1yE EoIqFMn9YifQzIQISHq3ZnHcnRWOcU+26x8Xmn/GvjRsJ8wpPkDUvSoUlm/Wz2D++Wks NWHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=1HAuIOhFlqhBwqi1CXEPVi75rumM2h3RcT/A965fhMQ=; b=VXISp8OJPl/ty6g9H8oDtSwQ25ua7CvBzeuP91Y0f4+ruxevuhcwtuye4prw/mC0Nx sxERmJ1f8+MUIZpSneZ5Gy35WHL6lZO+DYwM/9pe/kE+tA//QurlXl2q3w2eCaE27wx6 c5v5kgloTeH2HI3l1/EkwXAp6REOQ9P4h1IUNVK2RJZxHljqEzCNeq0KEjodj0dPpg6U P4vdN1uLCQHp6URT099S6LL8yEVo8SZNJ1N8+xjrRMZnSbrP2zRX1DA5ZEJi3oFhpxBr qjvNG/Y3xXW96hijnlHOBEiW/9ylPix3JfJEc+7NS75FzUVgP0sTmWNPyAbGhqiPsfzR ct5w== X-Gm-Message-State: APf1xPAgIOiSYl2SVME/5SpFPjaRmXt2q0DbMR5FxFbRyR99hWJJhcpn 7ARrnReLosKHje9xStKf44K8zw== X-Google-Smtp-Source: AH8x227Y+zIFWDHdYut5k9dqH9Z1LpSVVtcJihPASAMJ6MDFzAZyViHemPYG6gSz8BFAnSwnrKDQgg== X-Received: by 2002:a17:902:bc02:: with SMTP id n2-v6mr43938pls.52.1518634743195; Wed, 14 Feb 2018 10:59:03 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([49.205.216.37]) by smtp.gmail.com with ESMTPSA id j7sm17426259pfh.39.2018.02.14.10.59.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Feb 2018 10:59:01 -0800 (PST) Date: Thu, 15 Feb 2018 00:30:20 +0530 From: Souptick Joarder To: QLogic-Storage-Upstream@qlogic.com Cc: linux-scsi@vger.kernel.org Subject: [PATCH] scsi: qla4xxx: Use dma_pool_zalloc() Message-ID: <20180214190020.GA5566@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use dma_pool_zalloc() instead of dma_pool_alloc + memset Signed-off-by: Souptick Joarder Acked-by: Manish Rangankar --- drivers/scsi/qla4xxx/ql4_mbx.c | 6 ++---- drivers/scsi/qla4xxx/ql4_os.c | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index bda2e64..5d56904 100644 --- a/drivers/scsi/qla4xxx/ql4_mbx.c +++ b/drivers/scsi/qla4xxx/ql4_mbx.c @@ -1584,12 +1584,11 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha, char *username, char *password, struct ql4_chap_table *chap_table; dma_addr_t chap_dma; - chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma); + chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma); if (chap_table == NULL) return -ENOMEM; chap_size = sizeof(struct ql4_chap_table); - memset(chap_table, 0, chap_size); if (is_qla40XX(ha)) offset = FLASH_CHAP_OFFSET | (idx * chap_size); @@ -1648,13 +1647,12 @@ int qla4xxx_set_chap(struct scsi_qla_host *ha, char *username, char *password, uint32_t chap_size = 0; dma_addr_t chap_dma; - chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma); + chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma); if (chap_table == NULL) { ret = -ENOMEM; goto exit_set_chap; } - memset(chap_table, 0, sizeof(struct ql4_chap_table)); if (bidi) chap_table->flags |= BIT_6; /* peer */ else diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 82e889b..5896343 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -825,12 +825,10 @@ static int qla4xxx_delete_chap(struct Scsi_Host *shost, uint16_t chap_tbl_idx) uint32_t chap_size; int ret = 0; - chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma); + chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma); if (chap_table == NULL) return -ENOMEM; - memset(chap_table, 0, sizeof(struct ql4_chap_table)); - if (is_qla80XX(ha)) max_chap_entries = (ha->hw.flt_chap_size / 2) / sizeof(struct ql4_chap_table);