Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F367C61D97 for ; Thu, 26 Jan 2023 21:54:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229891AbjAZVyo (ORCPT ); Thu, 26 Jan 2023 16:54:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233055AbjAZVyg (ORCPT ); Thu, 26 Jan 2023 16:54:36 -0500 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCC4C3CE2E for ; Thu, 26 Jan 2023 13:54:34 -0800 (PST) Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30QJ4q3I024956 for ; Thu, 26 Jan 2023 13:54:34 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=s2048-2021-q4; bh=TUPS34rQ0CeKMzaTGv3b3tvstwJOY1BaeTHmyPVxUHY=; b=DLPow7rFpO3/AwGHtO7lXvlG7VUjLgPQEBGpGszyW4ismx8epXy91eGg9nefHbBeSA6v YD3sejAge4Wqo3/2dbwF/3X0PDGGK3jZZ07Zn39oZ7R6OtImBVJsIvuuqPUUsu2A15Te l2Y8/M4A9R8K6HKl8/DBrWPexLW1F6GuhPjxlaSxHhZ5SUVNUXTMVOXZOPKrf6QpXyfV idITyjBi4jeCNTcD7vlZjTEvCffvefclPZQ+lpcDQh+O8yyIcZDUwnmqRPW9jwvmw9us iaNWnLnP/d7gVlTVwa8YVS2D+d2sDbR6NkCT0jPsygucEH/wdytqsfB8EJ/WRlXIKSMV qQ== Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3nbb800nhb-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 26 Jan 2023 13:54:33 -0800 Received: from twshared9608.03.ash7.facebook.com (2620:10d:c085:208::f) by mail.thefacebook.com (2620:10d:c085:21d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 26 Jan 2023 13:54:32 -0800 Received: by devbig007.nao1.facebook.com (Postfix, from userid 544533) id 41B56FE80A9E; Thu, 26 Jan 2023 13:51:26 -0800 (PST) From: Keith Busch To: , , , , , CC: , Keith Busch Subject: [PATCHv4 08/12] dmapool: consolidate page initialization Date: Thu, 26 Jan 2023 13:51:21 -0800 Message-ID: <20230126215125.4069751-9-kbusch@meta.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230126215125.4069751-1-kbusch@meta.com> References: <20230126215125.4069751-1-kbusch@meta.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-ORIG-GUID: p9dx0QvDohvyje8ooDui9-bvFwcpNuTv X-Proofpoint-GUID: p9dx0QvDohvyje8ooDui9-bvFwcpNuTv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-26_09,2023-01-26_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Keith Busch Various fields of the dma pool are set in different places. Move it all to one function. Signed-off-by: Keith Busch Reviewed-by: Christoph Hellwig --- mm/dmapool.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/dmapool.c b/mm/dmapool.c index 900f2afa363a9..9e98065a68b1f 100644 --- a/mm/dmapool.c +++ b/mm/dmapool.c @@ -274,6 +274,9 @@ static void pool_initialise_page(struct dma_pool *poo= l, struct dma_page *page) unsigned int offset =3D 0; unsigned int next_boundary =3D pool->boundary; =20 + pool_init_page(pool, page); + page->in_use =3D 0; + page->offset =3D 0; do { unsigned int next =3D offset + pool->size; if (unlikely((next + pool->size) >=3D next_boundary)) { @@ -300,11 +303,7 @@ static struct dma_page *pool_alloc_page(struct dma_p= ool *pool, gfp_t mem_flags) return NULL; } =20 - pool_init_page(pool, page); pool_initialise_page(pool, page); - page->in_use =3D 0; - page->offset =3D 0; - return page; } =20 --=20 2.30.2