Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2996895pxb; Mon, 18 Oct 2021 06:18:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPwlDY4KOkZyYTmZhqIvCwCrvYqwsld9sx5p/CR9Qo9OawjRNv6FbbNn8MNomePUnwv7is X-Received: by 2002:a62:7cd8:0:b0:44d:4574:ea8a with SMTP id x207-20020a627cd8000000b0044d4574ea8amr28715820pfc.80.1634563109871; Mon, 18 Oct 2021 06:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634563109; cv=none; d=google.com; s=arc-20160816; b=u5FK0pwGGOK4wAzx5TmdJz4xIO/MTONuB9sFPrwZtduih//ak2oesG+nl85hpBLQZR PBlqU2wHf2K/0oDJ0YUGuIPmzTpA9ddTxLlfNwvHtAplu47yfv48+m+2ifLj5lymZw9y ZktqMdMr5S9dFIXIoD+fnRmGP6LUvnQel2G/6T0UJueQajB3KgtA7FPYrDdnrhnfLQWT g4fe0RROFeYM1NXUKwJEu7u/eEl7PY5WCnlgM07JGfxpovLjECfzdQP8NaE3ykxUNcbU HRr41bxUa1Yjr9gn8p1BwvfVMnj7PO/ix8z25oF/wO6zTssQEF8cutNJVMOac6dZpoMl m6UQ== 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=e6dF5S/AQ/tHVIS4vse6Wv8KQ/s7X0Y6bMOjDFP+oBI=; b=Oz1hF8ZAznyySsFOd4O+ZXSL/xK5ITY/2cfqR2fKe3+lkmnWHGdMp+G1olnlp1qc2d fU02ODBv7WkKWeLBpR7qhrSwr1iGGysAcmX3j40eunP19zmSvIFV9wENUHHk7jwX1zsD ZRIp+zXRYDODEZF7ijimz4RAYz328Gpjjl1yEqs64T3qARAtOyMY6KPKVHg1HWBxfI4J CmiRk7JSKnvrMMucgoNvLlzVQjnrUBARlyVFlZ0n+euBDy8bTNRtetFIqji2rlar1sYK 6ILszOqjmgNCANxXaXDEEYh3jfBY374Mq+JYfqZ8EM7WZAxvF2u9I5QO9oC/QsLyqqhH c1zA== 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 ij6si19952659plb.350.2021.10.18.06.17.52; Mon, 18 Oct 2021 06:18:29 -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 S231804AbhJRNSs (ORCPT + 99 others); Mon, 18 Oct 2021 09:18:48 -0400 Received: from mx22.baidu.com ([220.181.50.185]:59764 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231167AbhJRNSq (ORCPT ); Mon, 18 Oct 2021 09:18:46 -0400 Received: from BJHW-Mail-Ex06.internal.baidu.com (unknown [10.127.64.16]) by Forcepoint Email with ESMTPS id 965CB9716616C3D051F6; Mon, 18 Oct 2021 21:16:31 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex06.internal.baidu.com (10.127.64.16) 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:31 +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:30 +0800 From: Cai Huoqing To: CC: Krzysztof Halasa , "David S. Miller" , Jakub Kicinski , , Subject: [PATCH] net: ethernet: ixp4xx: Make use of dma_pool_zalloc() instead of dma_pool_alloc/memset() Date: Mon, 18 Oct 2021 21:16:29 +0800 Message-ID: <20211018131630.328-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-Ex06_2021-10-18 21:16:31:597 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/net/ethernet/xscale/ixp4xx_eth.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index 3e5fd952aeaa..65fdad1107fc 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c @@ -1103,10 +1103,9 @@ static int init_queues(struct port *port) return -ENOMEM; } - if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL, - &port->desc_tab_phys))) + port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL, &port->desc_tab_phys); + if (!port->desc_tab) return -ENOMEM; - memset(port->desc_tab, 0, POOL_ALLOC_SIZE); memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */ memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab)); -- 2.25.1