Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2998580pxb; Mon, 18 Oct 2021 06:20:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8/jiLCrfFvGtHAoG+mHcpjaqgrlaQh538NVRaAkoA6EK6zD5Mb5IbumfowIgnnQ5mrBp+ X-Received: by 2002:a17:902:c942:b0:13f:d1c:819a with SMTP id i2-20020a170902c94200b0013f0d1c819amr27312660pla.64.1634563212351; Mon, 18 Oct 2021 06:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634563212; cv=none; d=google.com; s=arc-20160816; b=TrjW9dkQ3YlHv4SoLI/tR2oXKPWIRh1q8ghOHxhydDULPGJZCGSsrL5h2LiJx7sGTi EaoG6YmjDitt382zniPmxPLZXPn9/k4u+P/gBgKBpiBg4mLc3s+4fSpE7WQrWLnHg78E Zowebzm+oMpn8QZBNFrdAD/kpojKrOCVXarf+Ak/SRn0wek+iMNOp7vioGgEl+PTpf+R NuLmh5HU6+ay+Xdsf7yTdshL2ImP01UTiFvI6tug/wzuMXMUHTgkDct7WiTfQTLY6o/K hI5mejRYBoUanD8xWcx5nzF4ecvhpDv/ABANmTGvTDe0cHQvqRcdqbWmyU6F3Rg0lV6J 3Y/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=7x9IQQKBfClFv35oWXxVLVz4kMfL5R8k7/9JBKaU5yg=; b=l6hXjaOhhJjsW+A4C2L1fZWX7aAHx89Bz8R4UC/VKKQ6NVfSY5/GLm88Piq3gphyGr QCL/AlQbVzVHXMKVqhsd4dRrSnZKU7rXT0uc28qyC3poIRC362AloE5DTDzDSl1MP46F 5ke94MSHg5xzaw1ERVSWUtRSuLQcy9YsqEzhF+jjgx2aeY7zp96SGQOJ8x1R4nMf1c0R Zh/F4kjfm6VrBvwvVHtAgK49JFdhvEuky9taDTb3BULJUf344YEShn/EC13O6y32v9xN UbOJ6zApkQuVehEYaEiqxLcXYT3lQbsGS/N7QmfLbFBq0snreHbFLnqUmSBO5dsJwYpj FUZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si18426507pjk.36.2021.10.18.06.19.59; Mon, 18 Oct 2021 06:20:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231852AbhJRNTA (ORCPT + 99 others); Mon, 18 Oct 2021 09:19:00 -0400 Received: from mx24.baidu.com ([111.206.215.185]:59988 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231847AbhJRNS7 (ORCPT ); Mon, 18 Oct 2021 09:18:59 -0400 Received: from BJHW-Mail-Ex08.internal.baidu.com (unknown [10.127.64.18]) by Forcepoint Email with ESMTPS id 03141209666CBD90F7B3; Mon, 18 Oct 2021 21:16:47 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex08.internal.baidu.com (10.127.64.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 18 Oct 2021 21:16:46 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 18 Oct 2021 21:16:46 +0800 From: Cai Huoqing To: CC: Alan Stern , Greg Kroah-Hartman , , Subject: [PATCH] usb: host: ehci: Make use of dma_pool_zalloc() instead of dma_pool_alloc/memset() Date: Mon, 18 Oct 2021 21:16:44 +0800 Message-ID: <20211018131645.434-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-EX02.internal.baidu.com (172.31.51.42) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex08_2021-10-18 21:16:47:005 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replacing dma_pool_alloc/memset() with dma_pool_zalloc() to simplify the code. Signed-off-by: Cai Huoqing --- drivers/usb/host/ehci-mem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 21307d862af6..4c6c08b675b5 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c @@ -73,10 +73,9 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) if (!qh) goto done; qh->hw = (struct ehci_qh_hw *) - dma_pool_alloc(ehci->qh_pool, flags, &dma); + dma_pool_zalloc(ehci->qh_pool, flags, &dma); if (!qh->hw) goto fail; - memset(qh->hw, 0, sizeof *qh->hw); qh->qh_dma = dma; // INIT_LIST_HEAD (&qh->qh_list); INIT_LIST_HEAD (&qh->qtd_list); -- 2.25.1