From patchwork Tue Dec 20 14:08:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vernon Yang X-Patchwork-Id: 13077914 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA384C4332F for ; Tue, 20 Dec 2022 14:09:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F33CD8E0002; Tue, 20 Dec 2022 09:09:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EE3FE8E0001; Tue, 20 Dec 2022 09:09:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DAC848E0002; Tue, 20 Dec 2022 09:09:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CD1BB8E0001 for ; Tue, 20 Dec 2022 09:09:16 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 9F8D5C0906 for ; Tue, 20 Dec 2022 14:09:16 +0000 (UTC) X-FDA: 80262866712.01.818C8B4 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by imf08.hostedemail.com (Postfix) with ESMTP id 1AAA8160004 for ; Tue, 20 Dec 2022 14:09:14 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="gW/RBp2S"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf08.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.215.181 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671545355; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=5OVwEEkuPuBsngehdDVCzETTIsMI352trCxfsywSxsY=; b=MT0vaHik4OXgMjpZTRMntJFVrMyNM0NOPJTVp8Se2pJ6rQ4wfuDzLZ53pIzMuDviSTsD16 t41Uy9XWr251ZBb1H3ExOc8DLe9EqP2i19GVfYaSkW/X5zAGgY8Mp5JBoiT4W2G50ezt7n xOx6M2gZvqe2ngZnBhslUvBAtUNkZks= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="gW/RBp2S"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf08.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.215.181 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671545355; a=rsa-sha256; cv=none; b=ELx4uAEG8D0EjznJiRYF7YRhSd2cKSzRjiWtryzItSg1++eM8PEcKnWCqs9LDmVNpHJmTx v/cY565IcD+v745VjoN6pYRSypka1SkxZlS4bHfcMxO1boBOlceX74k2/X2APE7fpJezmd VgPOynfJfTCP30xhX1Tuncknk3rtov4= Received: by mail-pg1-f181.google.com with SMTP id 36so8393198pgp.10 for ; Tue, 20 Dec 2022 06:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5OVwEEkuPuBsngehdDVCzETTIsMI352trCxfsywSxsY=; b=gW/RBp2SigLyvM5t4YXtjrPbAZeld2ZkK1oL4g2hfVzLrTh6vmRsI19iGkDC0YgZFn XEUHiDGq0AGeww3x20i8BRLQfMlVZR2pBn5TQjmbiL1PV+DCDkjz6zeJDLf2XF77SmPd 7ZLY3koftSueWSyCi/SmGUGg5N8Sz/S5DhlAcUyl4MQHIVFmG1q2iLyAoEfnFEvClPHF oE7IHv1m4mRHyrG736/4OTlNsio8uzulEV0ZCJua67QYZj736ROcF5qvB8n/Q5qTpye3 FqmVc2Sh+rkWph6dnLuv61aEbgVQJ7V068BSbj8ISvCS0QGagFyC33YtSZIMcW77A8PS Olmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5OVwEEkuPuBsngehdDVCzETTIsMI352trCxfsywSxsY=; b=bWomE/Gnw19JG2Z5/DsJiGJidLzgDoKCcf3+Z+yQxR3LuRg8C603KEot7RnR3ASB+8 CYw0dQuWYEgwAPhOd8TQevIq7XeJevfE7fCJyt2Vml75Nz/JR+B8kl3nwjHGJ+nvqzdE EvfxRenrNhQglHEPbkugiT6RGCO2EVIYAhL3GTKEcp/sggjS89tpvXLBJMJlAWYGoh60 KvvgOValiBR5wVIjQH2xABMkftXoBuuUY1CG8AT2SW13HtoAllPYB+Bm3XFFZ/5yQT3z 8pCAxiJzazZ2lXLSAAuIyKGM2i9SU0qaDtLaLtLlB6jGecLv+o4/JXmcloYHQklzqeNP N5og== X-Gm-Message-State: AFqh2kqpakm/OnjucvLbRvVKPZN2odfxH+KROWZe9xCgI+Ij8G8U1bNo rm2I6vsFEALcmuYpCTO2HTc= X-Google-Smtp-Source: AMrXdXuU3lgrB3sZVZZXrfY16ocXgQEhhfUOk4fjtLnLxccgnmCHhlaaqdVxSpmBRAr6ajbrRerQ0A== X-Received: by 2002:a62:14c6:0:b0:57f:a19a:385a with SMTP id 189-20020a6214c6000000b0057fa19a385amr11716694pfu.13.1671545353914; Tue, 20 Dec 2022 06:09:13 -0800 (PST) Received: from vernon-pc.. ([114.231.52.81]) by smtp.gmail.com with ESMTPSA id 12-20020a62150c000000b00574f83c5d51sm8654864pfv.198.2022.12.20.06.09.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 06:09:13 -0800 (PST) From: Vernon Yang To: Liam.Howlett@oracle.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vernon Yang Subject: [PATCH 0/8] Clean up and refinement for maple tree Date: Tue, 20 Dec 2022 22:08:21 +0800 Message-Id: <20221220140829.1665432-1-vernon2gm@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 1AAA8160004 X-Stat-Signature: j63976m17ddizfcjmyy4q6eyhae4toi1 X-HE-Tag: 1671545354-29607 X-HE-Meta: U2FsdGVkX1+b4/KLXmmeWxk8IOuc/MCUpY83bwIjFN0e8x9rYjKXMyGTrALqqt1YnkkFAZXKTfbS8cetQMi7wpexw3RmhjlYG69Tk7Hqbqo1CvrI/4rczmwxezSxCrCpkEKZA1Fhv6+zRSrzdZXVxVzM0VsNX519dNyej8nT+NZN3V3uDHxxNQhy1iaNoRP5IdIB27LnHX/kjUGG8nB6I6QKEN2pxdxLYRWqOyd4xzGbn1xJIzML1BrFXCxLQ1y4y2ktsJ5T4ZZXtKMo/Vt1IdK1hrI0SuPRsBC77jJ0hXiTcPVHW7oByLws3lVKR2gDu2fiPAYGOVR6NAaF1GxkesUNzuFD+gGev5vb3H5ZpcUtPMw8kvAg7iddPGgqa38Fz1tv6NU8tUsYC8DBMdW5XObtBM2E3Z3xtUCr2tLh6m7dAaEXmFtM6YKw8t00bz7CktjSnLMFsfkYmLi3L1+9xmfoVoMOVHou2+jwkpzuRQDXYx9oM/woLN3fRgiRPXm4ptB4Xza68L2a6r7ggER552z0VZkzRC1t8fJYNmnL9FastvbJCTBlkG48YnNoNjDeGVphrzcMM9MWk/Ymj1F53B7ofOG5JMfN1OiyEh9Agc2EIPMemZhohQ9jpMTSHC8kWi3hMOMlk6L01E/XcYnDbHvQ6N12HNrVg84sCfMpZ7tT06AZx8rGghLcs/ayhWTo2JYwH1jHygW+vliTPO3qIWT3DTbxRp1Rh34ZGZfJRDuY1UavBEjaKpyoLkbw4QAzjIOtQOB6eYr87WxvojggAC9id0w6PYLVaf85no3ypmKHpkgSgO9iYum4Wi1sNsSrvbQavvS2s3BkRXaOznmdohuZQrF+BThnilQVos/oNKSO9RGBaewbzMnsxtUijDPo9oSJ1s54mywqt6QGI6PruPWsgOfD1Sc+3iwLqdxHOL0PrrM8260cr9ZXME4HEd9jNV1wCY3f9C0vCOs/jT7 ubOg9weA xbIDFJPMZtqnyr0Eyd1ziOEdyAtv4VpeA+EecFFNaaPqT+uMAVvAxU1q4fJ87fijooOIfLpBV7DBrCjJqH28KaX/iv8+gnSXK4lt9cGugIs1FSqu7L4TjJmzG42/OuzntQ0BN X-Bogosity: Ham, tests=bogofilter, spamicity=0.000561, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hello, This patchset clean up and refinement some maple tree code, a few small changes make the code easier to understand and for better readability. Vernon Yang (8): maple_tree: remove extra space and blank line maple_tree: remove extra return statement maple_tree: use mt_node_max() instead of direct operations mt_max[] maple_tree: use macro MA_ROOT_PARENT instead of number maple_tree: remove the redundant code maple_tree: change return type of mas_commit_b_node() maple_tree: refine ma_state init from mas_start() maple_tree: refine mab_calc_split function include/linux/maple_tree.h | 6 ------ lib/maple_tree.c | 41 ++++++++++++++------------------------ 2 files changed, 15 insertions(+), 32 deletions(-) Reviewed-by: Liam R. Howlett --- 2.34.1