Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1427763img; Tue, 26 Feb 2019 22:11:35 -0800 (PST) X-Google-Smtp-Source: AHgI3IaogoYjOL4bKqVxPJFfXYb/iVwGx6S8somdqLM5S/ncUJSECC/t0P0gi+Oq5KUWxeflgN4y X-Received: by 2002:a63:6b03:: with SMTP id g3mr1378818pgc.239.1551247895844; Tue, 26 Feb 2019 22:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551247895; cv=none; d=google.com; s=arc-20160816; b=ngcd+eEQYPKwAnXrIsBsAtivm6x9VMc2oW9r/5WILZAs0mn52I8LSKqRIFySBZkRyd ouF+rdTFXSSnD/L3DPZmRpAn97Ezq7X7IUlfTXCzDQ54aBobU2gimeRmoRDaTL3M6ZCX m6cctKBd+hCKRHPwanS8/ZMIatilnJArOQBhJ+awsq3NwMnmmokzih47z9XeCE4Tlakh K4c2Z8a1X/LmS/ehzPZsjiQ86QXVQY9tpZwBAPBaaZofs9sdZUjSjYNNoXggCZ4/L42Q FM0YAe4EfxzPqurZpPuOxsgdJ8EN9/N6WukD8iwsIjAkUIy0ifNkcdgByIX/mksqW0uX utrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TQPkIngMrcE2+FBP5eq2WMfuREnfwAvMoO7PEvScLck=; b=apEu4qMMLlEx9yj3z7Jde3ZLNlXoe0xq/lZ0KErCoZnSRNFRL1W6wKwrgLfJ8/XSNm NMLO4afWh4qcQnmJ5wuZKqLgMr/3VmhIByDxSfqSXLhrmBGpfRUUQfMwRX1QySxDS/L4 lI2+yKxkmDWR6ym20GfBVAwYIGK13skz4O69nuy1UpzJreYzbWq9jgOWoU2Nh241S0nV h+BB7gL6I5p93uPDr8kEAfS1f0Nadh2PsM4vnecNoPzt+iLghDpzMBbetPrKxUlAvVfu NGn74SgSO45om3QCZCMLOLdhRARxMFL2Kd/FgLZUoCAzZFKHtE+Fp0fgmFIj2BBdhmMr EDgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aj0AzSAe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i186si13417488pge.120.2019.02.26.22.11.21; Tue, 26 Feb 2019 22:11:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aj0AzSAe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729856AbfB0GJm (ORCPT + 99 others); Wed, 27 Feb 2019 01:09:42 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45484 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbfB0GJm (ORCPT ); Wed, 27 Feb 2019 01:09:42 -0500 Received: by mail-pf1-f193.google.com with SMTP id v21so7458131pfm.12; Tue, 26 Feb 2019 22:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TQPkIngMrcE2+FBP5eq2WMfuREnfwAvMoO7PEvScLck=; b=aj0AzSAemII5Fgp7RJw0NR/FdavmYEIcKjSzD40kVAN9Cza4pOUgy/DcIn1nu4qsRu aaaGBUyBiKwxZJk7JFeSEp+9eCocU+ejBLmEW0C7wQW3ZvS3/Ln1aYAYeOo7s7kCMztS tNyuW0Nh6iSKQWvWAnfBV5dZxLnTXxgIHhpFiRYU85v42jNeukutSaRgoDp5AzVXPt5M VavTnfLaJMtJZJ76I0wcP0HmPs+DKluy1uQXXGHBMsriM+/B5RyNS0tnOopKfYri702Q jnXM7352hEr6jzOFEwjwHBC8gr+ycGGa4eLf9Mt00q4MjSMjQKzivWWhc9oyC6sEVDj/ 2D0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TQPkIngMrcE2+FBP5eq2WMfuREnfwAvMoO7PEvScLck=; b=pmKRv5PbIccC7Lg21r0c4kmts2SC39ww5uyWzUc18qz7toL+cElrji0+LB6K5gN1Cp Q3mCDMfRfY2x9IjHF6X2c9kgaorxSa+J2LK5w2LFtIQN2qMbBsi77L4GryWWR5wVfMGt T5r9LGKRhaTXRNpRihWlBdoC190+51G07+4YYf0tvN0GE2dhao2L1oLKC8I0l3v0WSpa w39IA19K/HKOck2NfHrQXWZ/IVqDGI7Ol+g+eh9GCz0MlPWa8WZrtxTMkKnDcxK/ei/g DWuCxCEKEnhhiC3QXTi7283EhMl5GuFREHxQ8mfC6HF6JpBPPnw3HWigPuJEOn9SAwKH nB9A== X-Gm-Message-State: AHQUAuYIOh4KwnCz9ww81lwkNPzTg1SLRGN6A7yzvFuM7q/BSTdmkXzS JU1qPYRm7PZWCowX2+Li++I= X-Received: by 2002:a62:e704:: with SMTP id s4mr29742pfh.94.1551247780977; Tue, 26 Feb 2019 22:09:40 -0800 (PST) Received: from bobby.hsd1.or.comcast.net ([2601:1c0:5501:37e2::87c4]) by smtp.googlemail.com with ESMTPSA id d5sm20733473pfo.83.2019.02.26.22.09.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Feb 2019 22:09:40 -0800 (PST) From: Robert Eshleman To: bobbyeshleman@gmail.com Cc: Tariq Toukan , "David S. Miller" , Jiri Pirko , Ido Schimmel , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/8] net/mlxsw: use pci_zalloc_consistent instead of pci_alloc_consistent Date: Tue, 26 Feb 2019 22:09:49 -0800 Message-Id: <9ddcd9104b83c58f74cdd350f462017ad0612d4b.1551246708.git.bobbyeshleman@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch replaces a call to pci_alloc_consistent and then memset(0,) with a single call to pci_zalloc_consistent. Signed-off-by: Robert Eshleman --- drivers/net/ethernet/mellanox/mlxsw/pci.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c index a2321fe8d6a0..388f349573f3 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/pci.c +++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c @@ -830,12 +830,11 @@ static int mlxsw_pci_queue_init(struct mlxsw_pci *mlxsw_pci, char *mbox, tasklet_init(&q->tasklet, q_ops->tasklet, (unsigned long) q); mem_item->size = MLXSW_PCI_AQ_SIZE; - mem_item->buf = pci_alloc_consistent(mlxsw_pci->pdev, - mem_item->size, - &mem_item->mapaddr); + mem_item->buf = pci_zalloc_consistent(mlxsw_pci->pdev, + mem_item->size, + &mem_item->mapaddr); if (!mem_item->buf) return -ENOMEM; - memset(mem_item->buf, 0, mem_item->size); q->elem_info = kcalloc(q->count, sizeof(*q->elem_info), GFP_KERNEL); if (!q->elem_info) { -- 2.20.1