From patchwork Tue Dec 20 14:25:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vernon Yang X-Patchwork-Id: 13077936 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 558D9C4332F for ; Tue, 20 Dec 2022 14:26:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D2BB68E0005; Tue, 20 Dec 2022 09:26:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CDBC18E0001; Tue, 20 Dec 2022 09:26:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA5188E0005; Tue, 20 Dec 2022 09:26:18 -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 AD01E8E0001 for ; Tue, 20 Dec 2022 09:26:18 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 52305C01AC for ; Tue, 20 Dec 2022 14:26:18 +0000 (UTC) X-FDA: 80262909636.29.9E0BE22 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf12.hostedemail.com (Postfix) with ESMTP id B3A2940018 for ; Tue, 20 Dec 2022 14:26:16 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=q0iadfaz; spf=pass (imf12.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671546376; 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=wmaEWyMbq+SYIJlOtMV18tUNIDRg/JjfkI+PyxC7ahM=; b=HL5joV3Nd4Rqbp0yG/NRcWSIHBdQ13NNyJLCf9UQpA9EqJJQuL39r+aG5xEHXViHzjYdah E9WKhK/egHWecWyl/68eixwn9rZKfNk3V1xUbOh/S2tQtTfUubiIZF1DEg/RX6BShFGHnO Camh9k5G8NGa/FfT00zlOQUSVFd4F5k= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=q0iadfaz; spf=pass (imf12.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671546376; a=rsa-sha256; cv=none; b=FI3Tk2baR+61twXe4Iowhf8Tj7zhPFE3BaGWgA10ysdz+7USFu0bodu6zUpg2mvvQamT2a Bq8zKUoOMUHzSs1UlkNqmlLV20fHpi402lYtlDvpC8TTuygr+JEZUQfJ/YoTguV6Nmkrnl ArP5BBDc2bEzOCUgWgx7m+r+OO9MBqs= Received: by mail-pj1-f43.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso16694643pjt.0 for ; Tue, 20 Dec 2022 06:26:16 -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=wmaEWyMbq+SYIJlOtMV18tUNIDRg/JjfkI+PyxC7ahM=; b=q0iadfazHe1+IYlSrbvINbM/UqFTgpwMPAdYMg32CpBaw23LmNYrPTOY4q24Ypc8BO x83WeHv7BpZvpAmNG8UykDNwB7N1eHH0tU3vsW0dEGp6OmT1NOA8BAbXLMEQ388m75ac WsSGbG6EDSGTKTTGNZDkrLXn5rrnQ58zKNbTX7sWPrDzi7atbtOJhzB+ARshj9xXLXPk QNXqyyG3AXW5kgkU67oKqg6BJ5fqKrbiCd85rt7EVI+0eJzXhAz41Tr21OImahokj+LU jWbk/Rfk6UMs/AN6wEGMVQeo168rC3lMGyPpqVozdC7jaaoEyxO/Ea5buZokqqg4VCHP drkQ== 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=wmaEWyMbq+SYIJlOtMV18tUNIDRg/JjfkI+PyxC7ahM=; b=aDGsRqnuLgXwJv3J4Dx3PnSKHi3Bgyc1tQsLwGlfjIL1Rc/CoibAxLpn2AAGmVaBwD PUKFJkWKIc0MET9jFbirHgqF+mAR0yGFjWTJqShmGFCsY2DciQyV7tEz2ZJdZ061qsV2 Ez8q91TOLfpG7jbbLNZ6mjsq7RizFLbi1/RnadxWE15J3UNmor+wPcVHnabwhUsx31am DO2AWxSGK6dVg1dT7bccCU/YBgmpPbI1aT5H7uAnJMfELu0QXRj7Mtxh+awXLVdRVBKk vEiQuTta8mdYh7/TkjvBP5hKsaYPuKPZ83+33i0gVtIOfS4Q6/lhGmDzqvSv+pxV84V6 NhPg== X-Gm-Message-State: AFqh2krFZ951TfAb1NkMkBrplipW0wf7M0Vaq7jqLMKontTjZrLEGumB lbqXuDQ5RT2Es1kw0oU9zxk= X-Google-Smtp-Source: AMrXdXvoD+iGmReeb5JKab243eLrMYXIN99GpTYIiexm5QnyOVU5OGfi0zTUQfU5m4nD77zHZ1ufmg== X-Received: by 2002:a17:902:e549:b0:191:3993:801e with SMTP id n9-20020a170902e54900b001913993801emr2473900plf.56.1671546375405; Tue, 20 Dec 2022 06:26:15 -0800 (PST) Received: from vernon-pc.. ([114.231.52.81]) by smtp.gmail.com with ESMTPSA id ik11-20020a170902ab0b00b001897bfc9800sm9383398plb.53.2022.12.20.06.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 06:26:14 -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 1/8] maple_tree: remove extra space and blank line Date: Tue, 20 Dec 2022 22:25:59 +0800 Message-Id: <20221220142606.1698836-2-vernon2gm@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B3A2940018 X-Stat-Signature: xanpbog8kx73hj5g9tukhnb6ee9kzfiz X-HE-Tag: 1671546376-733136 X-HE-Meta: U2FsdGVkX19qVr2YSgn1cNZXe311T8Gz2yrER4rJfT7GP3ylnKZS5P7qPTzMKWgsDyz/JjKZnoZAb+wXhYIQOeAuccpvSz4x9vmVw64Ppswgv1A/u9eGB1Ly5AZH+vuMDF+Aq05uKIePYHFBBa7Hs61Em5sOeImHySwimkgr+8HoSnRMfjgpF8whNK8X1fl63/joO/vGf4KjZw3Dkp7jjkRBG/5chm2saw/78tN/+AguB+P+hDU2BM1GXbXI1VUSRxiXNtY47HXlHFFNqGfpG+7xwcWdoyhgCTbezu6MhakcW0nw7bLZ6RkO15m89gqvsyzmy/U5hf5wxtQIwULszDlM4OK38Yzy9NXGobmmSuhdSqfSJFk/e0viOTq8Ump92rK9OGeXN8yIf5XijVmOv1teVihjwlW42MaOJGsWOrCLSlWmNM4vQETeliJxDs05qqdAeZtydQmf8AVrlFpMHml+9n/GjV2kjr0Rmjq5LptDbgCI942UYE/vZpAS7oOb0Ci10hFN7oRZYpGd3ecLjqpObIxh12LmMNspnONyFBrcipSRjrVanv7z1yc9p1lvYHMVqbg72dxolFXZxYtbHOajekjYDSjjkb8GuNooHLPGyFRY92WYcBnklh9/bQWr2UrhcnU8eKR/VtRWC0gv5H2f67/8ijVjbPW+35VOe/dT0snWN6lrzy9ZUQ1vR0CtT1Nr2yzoVT+bliIK13l2lMVlH0quNHt6WK3604VsBfFh+NVisOMqa6CwBdybcD1x5uNZYhOdd74laARGvx0xXJlbXfMJYgKQabSg4NhZXrZbi3+NyqblK6XB8ALw9/DJ0E8pw2uYXrzmAphgVYw6QyUPbCF+7o/jLRxseUmHKiqRLfSWzlFeiIE+zCYUU77+rYy9EABgMqwLwTcjdgqloWFdTvkZgaRYeYFgAFk7lP1pCyEfj6HKQUSLOb3HN/1kfCyqg6roK+URSTVbynR E1YOmVCr uuQC1e6RK50J/gNZwOSGJOOriu/JjKDsympwlgmMKOhN2gqqhLwMA/OIGTaFHFzBMtIsmXGRHqP+9nzieTrvK4pXx4nRIex+HDxFkdYouP3O/3rbdVAgO7L3SuVGID8qZxm4Iocf2j3S9QI0wcK9f5vW/+o/xGw+/jY+p3YFaU7ElwCc= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: These extra space and blank line is unnecessary, so drop it. Signed-off-by: Vernon Yang --- include/linux/maple_tree.h | 2 -- lib/maple_tree.c | 14 ++++---------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index e594db58a0f1..4ee5a969441c 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -517,7 +517,6 @@ static inline void mas_reset(struct ma_state *mas) * entry. * * Note: may return the zero entry. - * */ #define mas_for_each(__mas, __entry, __max) \ while (((__entry) = mas_find((__mas), (__max))) != NULL) @@ -639,7 +638,6 @@ static inline void mt_set_in_rcu(struct maple_tree *mt) } static inline unsigned int mt_height(const struct maple_tree *mt) - { return (mt->ma_flags & MT_FLAGS_HEIGHT_MASK) >> MT_FLAGS_HEIGHT_OFFSET; } diff --git a/lib/maple_tree.c b/lib/maple_tree.c index fe3947b80069..8ace65a5eea5 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -183,7 +183,6 @@ static void ma_free_rcu(struct maple_node *node) call_rcu(&node->rcu, mt_free_rcu); } - static void mas_set_height(struct ma_state *mas) { unsigned int new_flags = mas->tree->ma_flags; @@ -468,7 +467,7 @@ static inline void mte_set_parent(struct maple_enode *enode, const struct maple_enode *parent, unsigned char slot) { - unsigned long val = (unsigned long) parent; + unsigned long val = (unsigned long)parent; unsigned long shift; unsigned long type; enum maple_type p_type = mte_node_type(parent); @@ -502,7 +501,7 @@ void mte_set_parent(struct maple_enode *enode, const struct maple_enode *parent, */ static inline unsigned int mte_parent_slot(const struct maple_enode *enode) { - unsigned long val = (unsigned long) mte_to_node(enode)->parent; + unsigned long val = (unsigned long)mte_to_node(enode)->parent; /* Root. */ if (val & 1) @@ -1278,7 +1277,6 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp) mas->alloc->total = success; mas_set_err(mas, -ENOMEM); return; - } /* @@ -2946,7 +2944,7 @@ static inline void *mtree_range_walk(struct ma_state *mas) mas->min = prev_min; mas->max = prev_max; mas->node = last; - return (void *) next; + return (void *)next; dead_node: mas_reset(mas); @@ -3464,7 +3462,6 @@ static inline bool mas_push_data(struct ma_state *mas, int height, */ static int mas_split(struct ma_state *mas, struct maple_big_node *b_node) { - struct maple_subtree_state mast; int height = 0; unsigned char mid_split, split = 0; @@ -3890,7 +3887,7 @@ static inline void *mtree_lookup_walk(struct ma_state *mas) goto dead_node; } while (!ma_is_leaf(type)); - return (void *) next; + return (void *)next; dead_node: mas_reset(mas); @@ -4708,7 +4705,6 @@ static inline void *mas_next_nentry(struct ma_state *mas, static inline void mas_rewalk(struct ma_state *mas, unsigned long index) { - retry: mas_set(mas, index); mas_state_walk(mas); @@ -4716,7 +4712,6 @@ static inline void mas_rewalk(struct ma_state *mas, unsigned long index) goto retry; return; - } /* @@ -5618,7 +5613,6 @@ static void mas_wr_store_setup(struct ma_wr_state *wr_mas) mas_reset(wr_mas->mas); } } - } /* Interface */ From patchwork Tue Dec 20 14:26:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vernon Yang X-Patchwork-Id: 13077937 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 EA8F0C4332F for ; Tue, 20 Dec 2022 14:26:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 75FB78E0007; Tue, 20 Dec 2022 09:26:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 70F808E0001; Tue, 20 Dec 2022 09:26:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D80D8E0007; Tue, 20 Dec 2022 09:26:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 44C4E8E0001 for ; Tue, 20 Dec 2022 09:26:24 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1CCE8AB1B7 for ; Tue, 20 Dec 2022 14:26:24 +0000 (UTC) X-FDA: 80262909888.02.DB89768 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf17.hostedemail.com (Postfix) with ESMTP id 73E5D4001C for ; Tue, 20 Dec 2022 14:26:22 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TeiDgLuo; spf=pass (imf17.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671546382; 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:in-reply-to:references:references:dkim-signature; bh=HfWc+IW6nWXzRkOrGK/ueRRgIPCILPfnnkeIVCLq74U=; b=UQmUxbdwMnGksG3a96dXW9TkPhCRV6mZOx7FtL4yS2U+WOJuhy8++7cdOa9u4iaCHmzAct ZNZRa5ggE9vfUFUqC4Ndy1hI8eloI3WFtwA5AIBZgLwAyXGlGPPXZFJEjkcsZNEyFimBEM xjNyOFH+V3z/STDg1Wwg1vnStOUl7Lk= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TeiDgLuo; spf=pass (imf17.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671546382; a=rsa-sha256; cv=none; b=RSJ6inqia6f3HrTILa0ogFghjmMiuWoGmPlPjNoZUCLz55CpXg/GDV8CCtnGZ8tLb/UL3k ydZF5qSfrEPr6Kgjh08ys2K0mFAa4gSLep6iBJVr1FhsezZGin/3gecwE9jfWfxturZ90g soEnkY0LTLBpt0uUpJEYKT0+wSHGAYA= Received: by mail-pj1-f54.google.com with SMTP id js9so12583032pjb.2 for ; Tue, 20 Dec 2022 06:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HfWc+IW6nWXzRkOrGK/ueRRgIPCILPfnnkeIVCLq74U=; b=TeiDgLuoaSaSiPApyjb1Fhhm8t8VMCYNyiEN2ze8FJFk51Mtz/3aIwxLVxe36XME88 9/VdFQRiAhx7U3kvtv9zhNzvh1ZgS2aVflH9tgYbbX6yu9mg5ncoIieDsyKcUO0ChG94 YnpzKSksKjSCgfWOlsN3dP3ICB/Ju6jFGVF8+G2+EIpVEuPoyccstZnwmxS0x9I1QNPW sr3jMBSkUEWlzMGmWg/vCqaCKPyevnVxGOod6RSHQUg4t+eAOlzEmBXudIE5LHBIZqJZ AEJ0jGQKJWUuTLYCl95DGIV0oExq+QIiXNkHKPVto+PV3gtyX+zdtCSi97svN8f/Skmw J5Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HfWc+IW6nWXzRkOrGK/ueRRgIPCILPfnnkeIVCLq74U=; b=aEmV6zuY8is+Th6QY9mY7p+0EwlgP7O7hM68YBNx5WnwHERIpKLRfPX99awM97UDxr 9qVUHrayhSnrrPPVY7mER3jjZQ8wIkfTeKti3EUUPkm2u+5PDc/V2cMP3ixfSW1j/zay tDt6ahuyduFxBztiOvwhXUWVv3KKOeJ1TYIlnRq1qpbkySTtW/9uALKYWdi4/JDATNkM Q8LtUoerIHv4uhlKjTGW+LH1IgQqHgk+1GidPrFGwnV/1WGQu9lxB7wbpM0NyWyiYUHS RdgIR3crAVLlRFL+ECpxkiFk+DpEMsz3L8n9QEx2gY3R4opEO78RZtBs8cuPLpThuZBe L86w== X-Gm-Message-State: ANoB5pnh3PGYmWhbP+UmcmqUpjDexgsxL2D1iPJcNBS+/96zGphpgSdz LV6NK+2whkRWDVVEVs1cQX4= X-Google-Smtp-Source: AA0mqf4Jzoj3nYSEHFPpblQQJKZafsl2JD5FJFN8mWm1RMCGOXRAgrRwgUPRpJ5e+ZAnh8d8mn6GqQ== X-Received: by 2002:a17:902:ce10:b0:189:e577:c842 with SMTP id k16-20020a170902ce1000b00189e577c842mr50431735plg.45.1671546381492; Tue, 20 Dec 2022 06:26:21 -0800 (PST) Received: from vernon-pc.. ([114.231.52.81]) by smtp.gmail.com with ESMTPSA id ik11-20020a170902ab0b00b001897bfc9800sm9383398plb.53.2022.12.20.06.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 06:26:21 -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 2/8] maple_tree: remove extra return statement Date: Tue, 20 Dec 2022 22:26:00 +0800 Message-Id: <20221220142606.1698836-3-vernon2gm@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221220142606.1698836-2-vernon2gm@gmail.com> References: <20221220142606.1698836-2-vernon2gm@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 73E5D4001C X-Stat-Signature: w14kfrssuap4m6zpxs9dg11sa9e4w1ps X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1671546382-787719 X-HE-Meta: U2FsdGVkX19pL4kmLjj1RyESW7gajaqtDIy9YbEgEVRZarSfqgH0S0oy2uBfE/vn7A4jobemiwA0Ez6LlIRpr1OnkGIn7Z/yDgPg67qk++fGWeZRCj8LfUR6RZwN78DMaeK654/TjWGB7YFwL4+ASepElb5e5ztH2AHYj/UDJ6Ycj5lDpzeaIClwaakavLKlsE/1xIqgBqBsZLvxF65HFKekrUmr2Zv27CEG4nbJq+p0FLjmyt/JVISBotUGe1Ux3+tzEsG3xqxJIKZMux1tJAZorpRiiq0BiL1/Mr8B5aHAPt/WNsQHTR4J9CZoNawGW2zlM3cJl1myO3JynsTPPatyd9HXpX5Sp4j/gNEfONs3Ba+W5oRfjUK+qsbCfi2OMFuElNYdoHeapSnA0M6TjIoYdPmdRMi9LhRVgZhL0c5T2kjQZxO7J3MA7+/Y1krBQBkZtb1oIyAYQDVZqfGQO57LsEkzmqJ6/1+n9LMqaZjtK2V8m2dXqgteZ0xURavMob6QgP/hqzn2Eb2QG87/Z/Nhr5CmT0S4OtKz77sq1jb67sDCjY0c3nIbjW+DSc+abGiceCtwkRqnMa3gkPU5Dn51jj/7a8p0dT3/OSmyybYEjcJJZReFeP3jee7vZyYu4Lsp+4yuBmJUQQJLJOj2oAqNUn8aE/9hP6ea2OiuLCcdL8Caq2c0U5toaMYSauYd2UNeJCx/1oVZmkx/Jl2KFwDimFrxKyOj+0LUbYj2Cklf1XK2/O/mLRb/SwZEBVEVH3+bJICv+9Cl/nriNe7vUo93SxSfv0XB1AFZUHAz6heH6axxw/WmeEYJJzdCgwZjdCKL13uaS45SoXVhj0Nn8DoW2EphALZtg2uCtUzgB5zQSdQ7UDVZWfH/ZccG+AWBTVssp95dVp6d7cOMmdudJ1SfJto+aziexEw73WPkkARasSZqv3fyW+b1XcmxzAmSfG71fQU8rNSObT7Lz0I XSLu414G WSu1zoCQuQ+h0b89l32i8SAE6uZxACc15uzGcNEqm2m8tAEG02tU+fgHBf7lROPzUmRsrXU8BtaeZBkSf6MQC8lVodpLjr/iNORGyx/FXhYSyn4ECd48Rg2FL96YOIi7ce0zo6hiNG/Opv9hF/RhXeWmS6QfzoXqt5ioG9WivPw+okmE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: For functions with a return type of void, it is unnecessary to add a reurn statement at the end of the function, so drop it. Signed-off-by: Vernon Yang --- lib/maple_tree.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 8ace65a5eea5..34aa93c85d6e 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1276,7 +1276,6 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp) if (mas->alloc && !(((unsigned long)mas->alloc & 0x1))) mas->alloc->total = success; mas_set_err(mas, -ENOMEM); - return; } /* @@ -4710,8 +4709,6 @@ static inline void mas_rewalk(struct ma_state *mas, unsigned long index) mas_state_walk(mas); if (mas_is_start(mas)) goto retry; - - return; } /* From patchwork Tue Dec 20 14:26:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vernon Yang X-Patchwork-Id: 13077938 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 8C72FC4708D for ; Tue, 20 Dec 2022 14:26:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 256AF8E0008; Tue, 20 Dec 2022 09:26:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2065D8E0001; Tue, 20 Dec 2022 09:26:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 081858E0008; Tue, 20 Dec 2022 09:26:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id EEFB18E0001 for ; Tue, 20 Dec 2022 09:26:28 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id CC9D6409EA for ; Tue, 20 Dec 2022 14:26:28 +0000 (UTC) X-FDA: 80262910056.14.2E590B0 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf03.hostedemail.com (Postfix) with ESMTP id 14B2620008 for ; Tue, 20 Dec 2022 14:26:26 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=XIEcnWko; spf=pass (imf03.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671546387; 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:in-reply-to:references:references:dkim-signature; bh=RInimQUAJH6gGKd+DihgXOqmcnGSJ33LRPnqziACYsI=; b=06N/2bYkYrBhmf5FK8od8zDLHZhcfsY9X15Q9t+Hray+PhaQA1aBlBH7qkHC47ZLxBlB2u 5Y2iZp5efWK+Nqzd75ebkuAaZ3NdOwXizqAEPZL10BIW69d2aws26fUHDN7j4BIXUJ9YvQ e8l9YHcDm+v3TLWmcFvbCW+jXEEU4Xw= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=XIEcnWko; spf=pass (imf03.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671546387; a=rsa-sha256; cv=none; b=2/ZejD7eZeH0AvEtvpFmEe2CexAh9SftmRBkR+MaGxzWpqOp1OYM9dzGFNGNd1zvRXddAR 2MAM24JDf2c0k/rODC2I6NXPIJH0TB5OO6tGjuJMkJrdFLvp+k960a1kP2FbGRPPFjIO3p zJW/fzsR2WG3yywTU82xMlsSWGuDL+Q= Received: by mail-pj1-f43.google.com with SMTP id z8-20020a17090abd8800b00219ed30ce47so16631239pjr.3 for ; Tue, 20 Dec 2022 06:26:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RInimQUAJH6gGKd+DihgXOqmcnGSJ33LRPnqziACYsI=; b=XIEcnWkobtVg4DIxwFqH41x2Ge6wQKVtzVCpH+HAHZ9lrboAxazyK/Mo/Z2Uafuz7G oVxlJFG/hvLdO+asmcnKKWHeUxTK/DJq6T4n2q3O4Oj+zqjIdhOW7jCqU1aKoSIRefQx BQd2+PvqrXPf3e572PEis73X0EPGP7kGZimbNakPpcFYd9MD0yd7og6Zzi1igGaq0zVE i4F2JGU9FIC47BjZjAayOoLGOPa+APh4JFIToNjMdRYh4Zuet863l1DTN91GggWW6WYA juqMmEYbwbLmRAXIRSmP3eTkFdOe+fRpfR7vynpnlmaNhB7T/ChRAYGrrCGLk2IuR/KX VuYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RInimQUAJH6gGKd+DihgXOqmcnGSJ33LRPnqziACYsI=; b=BkLZOvCCC6iPi1UXYH+IwHoVEh4kmrrF1uEPSBg1NTnT/udz9CxxoxqF1/6hbBqIcm 45Ttc4v0QeGuHplrwN/4cO0VldJ4Zz5OKZb82hbQSbUfuKRgMPkcWZ0+hnoZAMXeGRVD IfARyr/skkwIwsLmcBRORkeY+Yi/dMTFa7vGlM3RHBmhK+qWNlGi6cECMbzSS3jBNJIB 06WMg0vmeuFzAoVOE8lBSL3lTu6nGNeStMEY+Agk3qr0cEbBhhDXfDWc/FvWRbcpseZK Hmn1+xTrZkz43eQMLKPlNieqEfiXB4Z3BtFdkoySM13pxklYpItkxKhimVd7bBWBhkjw sGYA== X-Gm-Message-State: AFqh2kpsP1JMpN8GHiP33Ye0rQdSCMcEXhlHNuvhWHDC7ZJ96w55xaow 4LCHqVbqLZY8eUGL52wUiho= X-Google-Smtp-Source: AMrXdXs7gvwBQc0QwQTsi06bOGn3/m/+wQv4kHmB9AFGvp1HZZowDJP4qN/se1I2HhNrMjR6065J9Q== X-Received: by 2002:a17:903:4281:b0:189:8062:d8e with SMTP id ju1-20020a170903428100b0018980620d8emr14791000plb.7.1671546386139; Tue, 20 Dec 2022 06:26:26 -0800 (PST) Received: from vernon-pc.. ([114.231.52.81]) by smtp.gmail.com with ESMTPSA id ik11-20020a170902ab0b00b001897bfc9800sm9383398plb.53.2022.12.20.06.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 06:26:25 -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 3/8] maple_tree: use mt_node_max() instead of direct operations mt_max[] Date: Tue, 20 Dec 2022 22:26:01 +0800 Message-Id: <20221220142606.1698836-4-vernon2gm@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221220142606.1698836-2-vernon2gm@gmail.com> References: <20221220142606.1698836-2-vernon2gm@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 14B2620008 X-Rspam-User: X-Stat-Signature: p1yocqop5sqbfpp7ro59hjowtpcg98y4 X-HE-Tag: 1671546386-838019 X-HE-Meta: U2FsdGVkX1+MpC874zVPHOm1VymDRQUo/86pT809mGkq5Py/LKU64XmuV9+KilWcdOMhWTPEDN6C4Gr98FUXVjcOEJo9qk5cpOQ7fx1+gBIapWnlC9BA07mqp2GRxBnaUzIL2Iz89supvE3MmjgLeR/qZwd+b/oAzIZwlPTHG5ZoU6tZ8Z1oSrIsAT/6duPJuYPsopOk4B7QfytgM9G7EnKd3MPBI86DhAYSjVeHe5u5VRUzyIdPrfxJL+wY4Oi/qFvWr4LOwwoqBFlhmVOZ4wtC3D9NsAHb6Khntp/wYEcVgVdYwl+/5V08gE5lsyKBPhFWqUJJARLECVe2n9CALLmkZsNZ4T8Tr7uvwn3aSM+nhKQh69Cvqnnwm4JfMUvvgptnwMb3Xd0TBL2pKj4GhZya0sdYcLGk0AwF3L5IsTD+5Uzdhk9MECl/CpkI4YNxl/bCFmHDqesGwvf/nEt8Qvt6JtIWP5bhFIlB4tDCSsMvRdzZAXzRM78jWzniZVAQULWVEdhnH2+/IcluW22sbXm7Q4LEQTv+gySE5piXMdrKzCzp/fEcWx3ysxLijlukWp6DivsMjl80llVWTWt9B1cun8BB5B/JLwg5c+oT9ayEbgnkWIv++Cf+QH/XkwDvsoae90W3POTWlntedzgSoERh6NaemU3vnwyYRKU2FperyyhNhFLlx+YG6neZ6/JfOzydJh/a+Tjo04ojiH9ix02qkAfCbJHSxKsRUpb5UanEutjKi2P8FkfI6fg8ksiNFwFZmUOozFoH0IOwOUcY/7WnGj1ik3SbfYqmlBXloOKF8Hnn59bsKLDtsZV3bWoR9/vJ6zK+3/gRZp7hBuAtTJLUXJf73qvrd2VOjaQIsFct5kP9tGHRvY6Djz8GU4/DisdxKbf+eB5dZ9Qw9y1cc3aAZDLsoirTyJ0bpUAF2mduHaV4RgtAdxY//YtUj571eGyfplRVGWvc+oEhT+3 vSzp32w4 hcdWB4PYl2KNvigJ5czsW6wlNxzT1uIv11yL2K58k9W1BECuqL+X9yvjM7ke9OoYiLXimGrTylp+j1r1dE8jeT7JVR1vA2+DpNwJkVIw7hx75oOjwv9hfcd9ZzQF6+N9K1eOA2nbiVUqjDtPyCTlZoBDOVVfYLyZmKj9M5ZUOjsuyOVU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use mt_node_max() to get the maximum number of slots for a node, rather than direct operations mt_max[], makes it better portability. Signed-off-by: Vernon Yang --- lib/maple_tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 34aa93c85d6e..3d45c515ed42 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6723,7 +6723,7 @@ static void mt_dump_range64(const struct maple_tree *mt, void *entry, if (i < (MAPLE_RANGE64_SLOTS - 1)) last = node->pivot[i]; - else if (!node->slot[i] && max != mt_max[mte_node_type(entry)]) + else if (!node->slot[i] && max != mt_node_max(entry)) break; if (last == 0 && i > 0) break; @@ -6830,7 +6830,7 @@ void mt_dump(const struct maple_tree *mt) if (!xa_is_node(entry)) mt_dump_entry(entry, 0, 0, 0); else if (entry) - mt_dump_node(mt, entry, 0, mt_max[mte_node_type(entry)], 0); + mt_dump_node(mt, entry, 0, mt_node_max(entry), 0); } EXPORT_SYMBOL_GPL(mt_dump); From patchwork Tue Dec 20 14:26:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vernon Yang X-Patchwork-Id: 13077939 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 4E320C4167B for ; Tue, 20 Dec 2022 14:26:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E170D8E0006; Tue, 20 Dec 2022 09:26:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D9F098E0001; Tue, 20 Dec 2022 09:26:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C67308E0006; Tue, 20 Dec 2022 09:26:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B82628E0001 for ; Tue, 20 Dec 2022 09:26:32 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9B87D160C0C for ; Tue, 20 Dec 2022 14:26:32 +0000 (UTC) X-FDA: 80262910224.08.81BC568 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by imf03.hostedemail.com (Postfix) with ESMTP id DC2DD2001E for ; Tue, 20 Dec 2022 14:26:30 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=qSfcOSDA; spf=pass (imf03.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671546390; a=rsa-sha256; cv=none; b=QsYxJY0YY6JLCB0G8ws4X8S2XEZ0lgSCCQfZFRLwBQrbMGfnQLuzDPJGb9xDvMcKn/LTsb O9tDZ8GvIhY5lPEqgGsqaKQkChpEabAS4IHXlo3oVmaTV1RVJm2PP6wtISzMUEnPFfuJYl CqsEq5xLGqpf6/Y6aODJQijVqfAKsL4= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=qSfcOSDA; spf=pass (imf03.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671546390; 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:in-reply-to:references:references:dkim-signature; bh=ICp33noRi3d9C8rE7NjY0TxUAoQ5nSMBxsmejGs1dfI=; b=Vm3dX3pmerdZT9LdCmYAMaVEJHXm4hL4WP76HmxkoALrBFQKa7bj3EPkjgwkgEotuuZzvg 1r5QMLdgLFyLRG4A21nmTpWOz9z8bvTL10ZbUxOu0vNNt1Dt0xWExe0T3rSPoMz7GBvW+E 6DgAEFdGlJ6eSp3hJEZzWQ1qG2zBC2U= Received: by mail-pj1-f42.google.com with SMTP id k88-20020a17090a4ce100b00219d0b857bcso12284948pjh.1 for ; Tue, 20 Dec 2022 06:26:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ICp33noRi3d9C8rE7NjY0TxUAoQ5nSMBxsmejGs1dfI=; b=qSfcOSDAXHDzAfM9Y5B7geRR5HEUpHSmMKAbDk3sxs2OROEkpL3sY2KXx/P1+40kU8 +VMUNvZEBRYCyFCXRMh4LZAIfhsSYnDA/UojcTUrtDqFIBgESZfyRmSNutGyjc3XshZS VCeMqfpXlxIr3XQid33LGe9NW3OjH/C3ZIFb8PDQ/dB/7lWET2k5At9ES7wOWb7HIoFY P/yCULGUCBkbNET8C0MQgZ1wv7vKtGNpShiDJ85BqkOV2cwCnoOQ+TiB5upeHir8itjR VGE2GtN4zg1ekDlq608H1Ww3Vp+rf/9PCSYc3NkgBJUtrqumDywN3ALSL4dLJv3hVPYX tytg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ICp33noRi3d9C8rE7NjY0TxUAoQ5nSMBxsmejGs1dfI=; b=iy+Api4R4dCkaXM8xBQKQl+vjZT1SSLdMBQ3w6K6RAEl+uHHtiZtnD6V87C0RpU1al 34IVfnnVanlKryDaIZdj09077tGOjQIOg301jxz4mhby/usnNg0OGw2rTmmNqSW4TrGZ WLXLw3HhrIqnato41G9ukSJJA7hKCAfw9HNhZgqNfgsxus/1W9yBI528zIWffoxdXAgI Bbxv2FsWPsm+Lis4dt8zLgOLtGOQDnca2mb8Ir2oq9qu/COz1mKOrvzCK9csX78gf5Yo +uTDm+dkVuQfIBXLTzSfPvGI1QS9al10iXFnqKdMm0DSIgC6CnhNfdbMSs4xLWSryB7i jt7A== X-Gm-Message-State: AFqh2koFXoJUpvkQmG2hhiktPp8/B0qnvLkXUhmftjM/aN1fOe+JKqBR J57JsFE0M0wLIYD9rmHTCdE= X-Google-Smtp-Source: AMrXdXsC/+bhuxI6XrkET+fpvWyY1FAub4d3VD14eu5U88kgdX5k4+HNIelFdjL8OfO0ZJEk6DwXWQ== X-Received: by 2002:a17:902:8207:b0:191:f83:636b with SMTP id x7-20020a170902820700b001910f83636bmr14345071pln.25.1671546389903; Tue, 20 Dec 2022 06:26:29 -0800 (PST) Received: from vernon-pc.. ([114.231.52.81]) by smtp.gmail.com with ESMTPSA id ik11-20020a170902ab0b00b001897bfc9800sm9383398plb.53.2022.12.20.06.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 06:26:29 -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 4/8] maple_tree: use macro MA_ROOT_PARENT instead of number Date: Tue, 20 Dec 2022 22:26:02 +0800 Message-Id: <20221220142606.1698836-5-vernon2gm@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221220142606.1698836-2-vernon2gm@gmail.com> References: <20221220142606.1698836-2-vernon2gm@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: DC2DD2001E X-Rspamd-Server: rspam01 X-Stat-Signature: hef9oxxbqacqsuzzwxut5nsfp6w1h6g6 X-HE-Tag: 1671546390-422688 X-HE-Meta: U2FsdGVkX1/yqk2G874OSf4eEmU3E+1j49/VGcjiLL1clySVjPCc4RZsWAMLDvQ3Nt5Br9/k6463lJ1k7BFTDXpHj1wls3rwH1C6pvgUJQ18X6j+9Jl/jw/y6T4f8/Np5c9MC7MJ0Xb91mAbe+ZyeyKm4a2wwWtiyiN09EL8ikLSVFRdOEsPmybwMCxYmrqhiprf1d9HkXQ+qOu65xVxuFS6iZiWCOUGxqlq6muzlz6XtgTVrxoH2ROBLm8DwciDy1Z1XftTD0+4UPMkA6WmcmSObJtsxJLbCk3WBz8SeNwRxegjbrD91e2H3i9RKVPRZLMkv3lcmXZDY6k24vqGb6U7uoMsZNhFE+hZ2OvKRH2uOixvkolAgwL0iGsEQXD19oH5j53pNh28NlEhez1uMC54A3IuA/Q4bsTo/HUO6/FWUjFaqsgJ7U/jjuk/Pefvgdf8EkmOJDQEOWi/fT9+0Ut78VdiWnpA5ehBgNyKXv5xkZSbnNu2k0b07enWY2OY0Y00x3PzTFXqgmObuLMzBlO4Y9VlYA0whxrqr+ygPlOWnFmEbMKPBDTii6sUJAqS2JnD7iBLPOHQenGg8BWtg8M4ualBRFb4pIaJItBGjDz8Dl4uRpQq1QQKixwg9s8RYD7FatVYCFMuw9kL81UikCWS9zZEce7qOllfvgQJZASQxOgqQokEMxbeKIL1P4lBJjrQmByoIq4KExM1Z7arHvd2B9x1nK6BFbMJkvGqcym6289tbhux+eOQr1+TchEaSrOPOCukj4Fx0NMgc4nrnsQWmmqcxKSDckP9HUUZUmXALkA1Kb3o8YWNqgm7TFUKqScglC5HLHEOW8T7l2Z0Hjaz/sHMpAdstOjswj0yPQEXEzLTcAgbXVUp5ZLtoh3ukkvBPkhux7hsyNtT81uJMQ4vo8XsBGMLoeJmoQ54eV5F/fE45HEoH8M5cUJmliv7jf5wqrqjVLp//2/LmYM zIzUbnQN w059PINFgCNg9olmitcHPFgkjmWfqiQbSXk1IowMvx8pGvezym9pd7mb/e2voAp6ljw1eidyG0KL+jI/s49vwltL/ZYZ5uRhX0L3O4aLh1oGVLJRjHCV+de9bZ0z5/nntMxXa9Th7hNWWyvCHD5r+yUJ6IHk5onBtrjDlcLPMC+14LAs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When you need to compare whether node->parent is parent of the root node, using macro MA_ROOT_PARENT is easier to understand and for better readability. Signed-off-by: Vernon Yang --- lib/maple_tree.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 3d45c515ed42..b3a215dd961e 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -503,8 +503,7 @@ static inline unsigned int mte_parent_slot(const struct maple_enode *enode) { unsigned long val = (unsigned long)mte_to_node(enode)->parent; - /* Root. */ - if (val & 1) + if (val & MA_ROOT_PARENT) return 0; /* From patchwork Tue Dec 20 14:26:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vernon Yang X-Patchwork-Id: 13077940 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 F3AE4C4167B for ; Tue, 20 Dec 2022 14:26:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 897748E0009; Tue, 20 Dec 2022 09:26:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8477D8E0001; Tue, 20 Dec 2022 09:26:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 70FC68E0009; Tue, 20 Dec 2022 09:26:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 636178E0001 for ; Tue, 20 Dec 2022 09:26:36 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2A8F314047F for ; Tue, 20 Dec 2022 14:26:36 +0000 (UTC) X-FDA: 80262910392.28.9A84981 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf26.hostedemail.com (Postfix) with ESMTP id 85732140009 for ; Tue, 20 Dec 2022 14:26:34 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=QAeeyh1B; spf=pass (imf26.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671546394; a=rsa-sha256; cv=none; b=jGVr3uTX5so4+rb7KhrlbHfe2RUzL/KZXXmnW4hUwrlq+xK8SadWML/witPBYzRGPfrazS 4k7Z4jVM8vVJI/jtcA4HOP7r3OdkObxKH5BB1IPyYsrDKHWsyx3S6/4b7TQGdbKMx0RNJt KOcB9wq1IPTnyLwNFYvO+NSbKId2FO0= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=QAeeyh1B; spf=pass (imf26.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671546394; 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:in-reply-to:references:references:dkim-signature; bh=Bn2usd8RhSGSmZWb5B1NWCCF5E+CujnFtBp0hU4Vhaw=; b=B+Y7kn/SjIHMD/UsGAY5K5paYqYBnaYsBPc8jUtq4EkWMMWE5MZT9PPZGrShUR9MZBfnPL 9X9Al3rHMy6WXU7pLNI1FU2TIHA8w4yIqHQLvxt9gkUGyzknBwJMc4WDBQr8ZIA2HiMYWS YYY04VuRoTj59jOOHayhCjT1uEjlUvE= Received: by mail-pj1-f48.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso16695452pjt.0 for ; Tue, 20 Dec 2022 06:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bn2usd8RhSGSmZWb5B1NWCCF5E+CujnFtBp0hU4Vhaw=; b=QAeeyh1BDYIV8cysQl2toWaUGz8d3JI5Fx2R7je5aKyPI8FrS9vaiR/WWyQUfMZGHO toNL8WesHyJHxS9B5e+U2mFpDVG4didblkCkoBIA+RIAw+EvyVLAc2gNxEAuws6MyNNZ Rek1JwcQmqwB9CveuiscUcQc/7dmK7A7FCE0DTwv1JUICXSZVjsHtRQGFT5L65kpQQTX h56Ljtc90jh1ZPUWtZzsumI07vT0462LU6Sh0iOM4l/zqChr0l02cdrH3m5PLzfujitC HcAyxPjw7KYBQpGRkyoOJxaCThVEAbZIGLvu21lT3ORsUjc4tAJnQnHRJCw2KKa9V03d ag2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bn2usd8RhSGSmZWb5B1NWCCF5E+CujnFtBp0hU4Vhaw=; b=CeStpKh5Y+VGoL4ADy5lMsUp3wn3XAgXlTQAdg36OTYaU7ZeuzsEcmmN8X8M/IwpS3 AwLzijjoEUTt2u/bLCy0Yp6Drs8wb2RqIGWZhQ6mNs693ASEknoJlEyYykYMXXW8WuBR NLxUyohcnwYCv0DfUMDFfAa1bmZSG0bQHj4Ec+BC4Mb0xU/NuoHWY6JFpng7KECANL4l EH72m/PqQTeNtaaAN+ZfGouQ5VRmPnfEuBtgKyRBDnTRA+6iqGAKWv46TGGLlcA4x8ZX JcsXpIqIZMYE9ai8QB70/fwzSEL1LOrugyK38IZrzaJ20IEBirgjsbW8Hp/jDvjUe/L5 vTSQ== X-Gm-Message-State: ANoB5pnclpFk5SUczt2g1PTYk1yr72Dx1MDh9ojdEJkHbul7AmcNSNhd 4+cBQ9c9/MjQbqW3N39DWSVnPXhwCCZ2xDIzUVY= X-Google-Smtp-Source: AA0mqf6XV9AK7/ROL6sxQsVqW/vSv3j9dGERWBjFCKqTC/Hkp51i5+bxCYvWKi5cl933ffR6sQsiiw== X-Received: by 2002:a17:903:26d3:b0:18d:9214:1ae5 with SMTP id jg19-20020a17090326d300b0018d92141ae5mr43056033plb.23.1671546393514; Tue, 20 Dec 2022 06:26:33 -0800 (PST) Received: from vernon-pc.. ([114.231.52.81]) by smtp.gmail.com with ESMTPSA id ik11-20020a170902ab0b00b001897bfc9800sm9383398plb.53.2022.12.20.06.26.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 06:26:33 -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 5/8] maple_tree: remove the redundant code Date: Tue, 20 Dec 2022 22:26:03 +0800 Message-Id: <20221220142606.1698836-6-vernon2gm@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221220142606.1698836-2-vernon2gm@gmail.com> References: <20221220142606.1698836-2-vernon2gm@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 85732140009 X-Stat-Signature: w1c7f675kmn8wecu1pon8mje8x846nae X-HE-Tag: 1671546394-201652 X-HE-Meta: U2FsdGVkX18LamVZa09ahyR3ZkKvRivHgyusD/fkyLIIDSkgYmdOjS6prxjM9T8dHtoiT3WSecleNEnX93yr1BSN3fkhBZRY2u6Fv1x6bFHrCf7kzgVAI+6227VEbJAYqs6VG/YyuXyNEzwcEzvaSa1uGKFQnffk9h1FmOHNMQuq+W6WQiUREfkTLAmpth4y1IOH5UB9filxHfNzZLwKDIcoCLMhmyyhPO9hpo/tDEhh1911TiRM7BuOm7r0jerh0YIvp+7GtNrgv4eEsSDT4N7GFRo/IlYdSxiIbQwCt0fcNQWCn8ZB9/RchvG0XyLwkz6KDPiGqNMiEhGEjZnqpBtAF4GfZU/vNE5twTwTTx0r2AxAiUEtvxesqtmH/ynb68tcwoPvPaOpDeu8qDsWcIGsTQi4Pix/x2p7Rxpw6zdSrFQFilmKE/WvuxA93AaS9cWNnDRn2POqNiVc9UUDlygshi2w+3DulljnbxfbF895V3O/UZ1cWT1CF5Cy0z9DgLvuAhLa8leRaeI0azHcgEQ65PMfFnLGyiwXGmY9qPKV5/4A9ktTxlQz71aTkYkjOJz7b4CGcHefo4deLyIS65DWi5EQ+DVvv3bkHPkbufquNU4Wlchmb6tOjRWHRhUjiD0x44fXInPuVmsrJevcKqzXWj6GBy5sQImZJMw4Btxzud5uheOE2sawu6wQiE4Pofay0crVWRJyDNWqQB+1PbMuBT4IrqS/T8KJ3Zp5jq1zdwuW1q7Vqv0empW/4gfCIY273wzDG28qCr0o2MtpTEQ1rjBlzbtSgBvIdLAF6d6UirtimYO7kk+lpsUVvIK7M6wMbwPcbibaTlLdK4XC/AQGt27H3F8SOVJn7XS2qhqYUVTaog5V6jOwqJ1O+6ouk0YxaMEWPiTMLF8BMdfnCDIpBWniqQmEEoWXHac4swux3OkbmepU0VT1WHad8X+HSU0ymVZeEpdUOMiu+/6 J7swAEpI oRkXr0dXRKa/ZnUnyu0FYqd40UUfClw8e1eli1fZPZ651fEeKtvfNgWuMFUlc4F5ZgeV262Jlp856lW/XOXvqUae7llUnUUv31HylWqTk2pj70/4BI8/8R7CF3bHYr8kN7hDlfEhP3+jq/d3INnzYDFrur0EaDj4S0vgxfQ/G6v7bqqc= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The macros CONFIG_DEBUG_MAPLE_TREE_VERBOSE no one uses, functions mas_dup_tree() and mas_dup_store() are not implemented, just function declaration, so drop it. Signed-off-by: Vernon Yang --- include/linux/maple_tree.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 4ee5a969441c..815a27661517 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -12,7 +12,6 @@ #include #include /* #define CONFIG_MAPLE_RCU_DISABLED */ -/* #define CONFIG_DEBUG_MAPLE_TREE_VERBOSE */ /* * Allocated nodes are mutable until they have been inserted into the tree, @@ -483,9 +482,6 @@ static inline bool mas_is_paused(struct ma_state *mas) return mas->node == MAS_PAUSE; } -void mas_dup_tree(struct ma_state *oldmas, struct ma_state *mas); -void mas_dup_store(struct ma_state *mas, void *entry); - /* * This finds an empty area from the highest address to the lowest. * AKA "Topdown" version, From patchwork Tue Dec 20 14:26:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vernon Yang X-Patchwork-Id: 13077941 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 4E153C4332F for ; Tue, 20 Dec 2022 14:26:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E15968E0001; Tue, 20 Dec 2022 09:26:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D9E8B900002; Tue, 20 Dec 2022 09:26:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C40548E000A; Tue, 20 Dec 2022 09:26:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B3F488E0001 for ; Tue, 20 Dec 2022 09:26:39 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 926AE1A0815 for ; Tue, 20 Dec 2022 14:26:39 +0000 (UTC) X-FDA: 80262910518.19.667D9D4 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by imf08.hostedemail.com (Postfix) with ESMTP id E74AE160009 for ; Tue, 20 Dec 2022 14:26:37 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=pwS2mq20; spf=pass (imf08.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.214.176 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671546398; 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:in-reply-to:references:references:dkim-signature; bh=64X91MxhUjBzxu+FEguvTjtV3XYA1aG2BvuE/3RmIsU=; b=mvfHrNUI4AnOaDAeDhGe04qbewUYCwuOcwkSSASpjY+nvKpTZ03M+XbyQ8+WtP+QiqXX6Z G2qRpDu9jq78pZ9VZezKkh8VT19j6M1r+tSrkJSJw6BIdJQboh6vlGJmwnYqQHjdyp4eQg vxFrHtHwF/3R18ywI5VrUrefeoHNQhY= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=pwS2mq20; spf=pass (imf08.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.214.176 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671546398; a=rsa-sha256; cv=none; b=CIkLr9nCHk8e36DrsUIiYeMP23Nllp4AXdPLGaxa2hl5ArXXVJhXpYpAEoL7ApS4VcK32Z eWT5UnkORQNJFxw3kX8Qq0SuPpa6Oda3/yNQ86F2gEVMRl2xcbFyMCNTSZ3BlYBfsXJmfR NFYLUtr7jdc8rwMczwH6IY2wfi/+IFc= Received: by mail-pl1-f176.google.com with SMTP id d7so12403267pll.9 for ; Tue, 20 Dec 2022 06:26:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=64X91MxhUjBzxu+FEguvTjtV3XYA1aG2BvuE/3RmIsU=; b=pwS2mq20b00ht0wE2sWSAi//5IyViRE4tk4NShJksyXTZz/akL7cBWz6/VHCOlXW8H 5lpls1Jrlydt+SfvxiSDPAMt8uunxlGtSWYoZSb+FJp8D6WqxZNjqdMojTi4Dg39wJ1s +MyNdHEZqmyls/+f+7XKUzdi9QYNhyBibjLQObyULeQtIHrdIRFPwjdpK3qBp8kcqJWc EobCF9X3GOOPdg8Na3/ISn5vAP74qhE5ovZX85ObPYXCY1BdYnMAVsFBpZDtvRVsXpZv 2k0X9/Sep5GWsomQj7VHPmITAPA33n06HzYrqGUiKpUNVQPsRymZW4Nt/tW2IdGzGJY3 POfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=64X91MxhUjBzxu+FEguvTjtV3XYA1aG2BvuE/3RmIsU=; b=pTSnS/ikUOkV6Ym9194YUkafgv725gL7NPMETLxYbhiX70phliI91oePoPuSag3lps sf7CeI2FMmmimQ0jpwYX5O+9tKWBWJz6XVYD5CFgbm7RQrFlrlwL7S2XdLSJsM260awx I7mM30AFrGRCNdapLs6Xzw/lj9gL0Gh9CbJE0hH+DyUobh6crx/+IN42+bIMrUOqN5IM qMQkcBM2QY7SP3DJArQAVXl5fkbS1PI0iV8PqxOE9XKdvI0fNMjvT3uqaS2vI5Ya4ocX g03zKNcq22EdWFihJGdaq7seeUNmfiOIlQRT0DFTUQy6XVy/5aH3fyI/mWkYqFyocIQq /zvw== X-Gm-Message-State: ANoB5pkPQO1K2+/Q90xSUg3wuMRx8kUkEIdPBKDylwTPa3ZzZWsILv6v O1X3Jz0iuLrfvPcxJecSsEI= X-Google-Smtp-Source: AA0mqf4k9upkMP0HrkhE5OVZzy1A8zaOGUBPPVz6j2/KB5BycYN82mg+ag6TUmJNR552xEd5Q/fchQ== X-Received: by 2002:a17:902:76c1:b0:186:ad88:43a9 with SMTP id j1-20020a17090276c100b00186ad8843a9mr50979497plt.36.1671546396976; Tue, 20 Dec 2022 06:26:36 -0800 (PST) Received: from vernon-pc.. ([114.231.52.81]) by smtp.gmail.com with ESMTPSA id ik11-20020a170902ab0b00b001897bfc9800sm9383398plb.53.2022.12.20.06.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 06:26:36 -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 6/8] maple_tree: change return type of mas_commit_b_node() Date: Tue, 20 Dec 2022 22:26:04 +0800 Message-Id: <20221220142606.1698836-7-vernon2gm@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221220142606.1698836-2-vernon2gm@gmail.com> References: <20221220142606.1698836-2-vernon2gm@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E74AE160009 X-Stat-Signature: c7sio3y61ew5xwts65ueqec1cpx649oq X-Rspam-User: X-HE-Tag: 1671546397-780691 X-HE-Meta: U2FsdGVkX19lUMf1o3v5EAIaqKpnfgqWW7a0Z8WOGY/GX4wzZvHLm5n1OdrcWeN2FnI4AMHEbyUZfJ9D1PTtqY1Iz07KE0kCRy9MFlIsxFpKZtrY9GAh1AeYagjpD9USJ6Me0GbL+ZzkT8lIMMMeKEff3P4u09oupKBMd9Cp//5FlYHsajZjorGWBEstPzG15qJsKcz9sSOLA8dBEKn6LpZJBH3DPZzHQobK2ir4iq4d/sWboawgpYnbq5PSmnsIdx24BzTwD44I5t0+keEHbtG5ITLDUR4ADCih5i3QKHe1jFe+PtU7bFOfT9LxAplmvb+MlX9y1rrH9jH3rAx+AO1Be+bIECaUkrQ4A+InCsi9QDVaP41QgpfG+CV4keKEOwZrxQgB254hAPYhRTD/UbBMdMJ1HZqjALI+UhY/DPwWKxYDI0OyimEWirdxq92Dw/upI/AXBg+mlbbL68Bmu0pEkF8prQ7FWDUqaZexcyiGeDx/FM591ESWFXoiQDl3UuJgkiVt/SyYaavorg2DiaNP9rGqDujKkoaSEFgsJKwgAA/t1GfhUjXqtEmmTaEhOO8jDYmIzRPD+AFN2YfvEoGAxlbYjh/9XT1rLpmRb17be6navLQSA0pVkTfgJop5Fwtk4v01KuiZzDAWt8GXyq+4SDSFKmGi5SBPWpgRGrXtP0VhyXdyjAWz00Vy+xIAtSupngNvOMav/Pl8eNGvib/F2X8HYUFMYhk8LNfNne98ZIiYbPM2gdzr7NBqXnaBAGXaHW+VHfrSg8kPMjGw0sLdlopuuaJaLdZTU9nVrBcdjuHUGEFixZfNDFQ+rLOFZaPsDbo917d+djwedH6r5jzHqxVHN0xVHlmc9YQiDm0pKANF9hqWOZvwdP0UP22nevPcRIBvr6BBtBraKxDg22XtvfemXiky2JbDU4o6QY99DW1sK8ASsECIuBJ0gdy1pxNht68V3bI+gjkGEtA l5z/3AJQ eRbJeLyBcT7QykWCYSm76cWvNR3X3Yc9DfNGE+yLkrAt7rVpwQJNDLi8LMFixqstOi5Vy8FNt4cOQq5K2bBe0lV7aY5Oi/k5j2cdH385puUDmS9TqywTwO+OlT95fj18e7YjZh9tDfbZ4IGmmPb1VitmNVB82KXRm6efm/AdJI5/053Y= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The return value of mas_commit_b_node() function represents whether the submit b_node is successful, and can only be false and true, so the return value type is bool is more appropriate and for better readability. Signed-off-by: Vernon Yang --- lib/maple_tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index b3a215dd961e..e7dde4a1d6cb 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3578,7 +3578,7 @@ static inline bool mas_reuse_node(struct ma_wr_state *wr_mas, * @b_node: The maple big node * @end: The end of the data. */ -static inline int mas_commit_b_node(struct ma_wr_state *wr_mas, +static inline bool mas_commit_b_node(struct ma_wr_state *wr_mas, struct maple_big_node *b_node, unsigned char end) { struct maple_node *node; @@ -3598,7 +3598,7 @@ static inline int mas_commit_b_node(struct ma_wr_state *wr_mas, mas_node_count(wr_mas->mas, 1); if (mas_is_err(wr_mas->mas)) - return 0; + return false; node = mas_pop_node(wr_mas->mas); node->parent = mas_mn(wr_mas->mas)->parent; @@ -3607,7 +3607,7 @@ static inline int mas_commit_b_node(struct ma_wr_state *wr_mas, mas_replace(wr_mas->mas, false); reuse_node: mas_update_gap(wr_mas->mas); - return 1; + return true; } /* From patchwork Tue Dec 20 14:26:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vernon Yang X-Patchwork-Id: 13077942 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 4C99AC4332F for ; Tue, 20 Dec 2022 14:26:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DCA48900003; Tue, 20 Dec 2022 09:26:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D7846900002; Tue, 20 Dec 2022 09:26:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C3F7C900003; Tue, 20 Dec 2022 09:26:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B25FF900002 for ; Tue, 20 Dec 2022 09:26:43 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 851FA120A4D for ; Tue, 20 Dec 2022 14:26:43 +0000 (UTC) X-FDA: 80262910686.26.23404B4 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf18.hostedemail.com (Postfix) with ESMTP id C325B1C0009 for ; Tue, 20 Dec 2022 14:26:41 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=MjWc8w+J; spf=pass (imf18.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671546401; a=rsa-sha256; cv=none; b=jNkJdNXE28L6ULceXOKkm1YAPiYKioZWr/a8hvPIdFe4BveQYmkAzjUDnCkUGgxP6HfY7l OiZJ19fUUPo2ItRAMX0xM4OAotP1e4LsbbFNpi2oTVcDA0Yk4WyNeepAJAftIymwsAKI6s h0aCx3d+HClDJbB0p5woWPSHNxLvX9E= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=MjWc8w+J; spf=pass (imf18.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671546401; 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:in-reply-to:references:references:dkim-signature; bh=WdykleZ4reuZUDGuALMZqWmYTc5/lzRFBIQz0bC+lNM=; b=dMGwRu7RQ+dSHTZU8N/5TFkWDHdkCiY9IfogQ6t0gx0p7U/xrrWCJJGR8/Zsc2K2bM6t1Z NYMZ1JoFXhRhCrx1j3ECUDbKqEiy3GWD7pdOnzcdrFJXfZFLeIG+XMsdrfrfOqNon6hTGd 416JtiVVM0KrLxCzm0uMEqqT1tN6DVo= Received: by mail-pj1-f43.google.com with SMTP id u15-20020a17090a3fcf00b002191825cf02so12279199pjm.2 for ; Tue, 20 Dec 2022 06:26:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WdykleZ4reuZUDGuALMZqWmYTc5/lzRFBIQz0bC+lNM=; b=MjWc8w+J1L/tQILl3fKHOTFPdPs4BkgGvNq9Ml0XhG6X+6LIzrSZQOi3N6Dt2yivwF x1VWHknuFzz/h9fQO6fsK+pGbqdDG9ykURDlJPWXGCLIWAfKmcaP6+gjc52dxFKODS1A VPtN5QlkkET/bPsQltPV7i/6/QA+N9vRe74+/204GPE7KL9Zry5fXf1didvfwwwKbFMk eJpotQlOzt/ox/8DO57kgjajFvSe9QllroD4IwNLNqdPIs3WYTP3fUrUczTvExvA4efz 58wPCroWJz1YGYjBTPIe5C8uvianCzXItcy/sHWPhhtUlyVwjRZL+W4uEUK7SF5dsBdM WHtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WdykleZ4reuZUDGuALMZqWmYTc5/lzRFBIQz0bC+lNM=; b=UC0ygUiCE7G9Zc1tT/4yfAWA24I8iMGLpUgZKX6XDLivvbgSMLf/2zmpF0Lxw5mTRW +jQUOXyM0InFn28O5zHiw8N1quhWcKZk/skimjWxFa6i0I9VpjGDAL9yP9ZlvLGcVEhn 6rvrN6aVRifN3sIlcS/mk6RZRxMi4gePDXwi6/WVSdbhlmFrGs0GmLoAAEHxNKXNA0wn CSGTbmIEqIJamkgQ5N9RCwQp6RCf+DkifuabeobCvFSLNeoliOWojcKUnPt56tD9eP3I eWKCnJnj3wF/1nA+l8QRjIWk5iFY71CUwzzfnPKXKLMIaEX/+1zfHSJOSVHuNyzGQJxK Xypg== X-Gm-Message-State: AFqh2kropCr+jwK/AekHrqtqZAXe0GZCTQQZzFE7yCeAymU1V2JXDWFq 3x5XEIEZq7pWJRh5HbysKk0= X-Google-Smtp-Source: AMrXdXsBSW0EHE7rAoMotD3hOgcA/OPQtakxM4iNqFUFItIPYliZloQamq8otuQdfILXanPorw0cxQ== X-Received: by 2002:a17:902:710f:b0:190:d69c:1418 with SMTP id a15-20020a170902710f00b00190d69c1418mr12103783pll.2.1671546400816; Tue, 20 Dec 2022 06:26:40 -0800 (PST) Received: from vernon-pc.. ([114.231.52.81]) by smtp.gmail.com with ESMTPSA id ik11-20020a170902ab0b00b001897bfc9800sm9383398plb.53.2022.12.20.06.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 06:26:40 -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 7/8] maple_tree: refine ma_state init from mas_start() Date: Tue, 20 Dec 2022 22:26:05 +0800 Message-Id: <20221220142606.1698836-8-vernon2gm@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221220142606.1698836-2-vernon2gm@gmail.com> References: <20221220142606.1698836-2-vernon2gm@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: C325B1C0009 X-Rspamd-Server: rspam01 X-Stat-Signature: t3m6151h3a9wiefetrfuohoke3em34y4 X-HE-Tag: 1671546401-226395 X-HE-Meta: U2FsdGVkX19zGCAPdP1WTa5fmjSn5PoYxBYsUlu+/HVR8zXBRDMMkC9OosEdqryBz/sUZUkBW3ybMgnWUJWhv9DfQraWEiM9rRCCb5CR4PuqA9hp9VWN5i19DdGe/4kYzgh8lU9LS68GZI3VXICYUpnUYxQIK8ZCWtIYTMIB5xgJnddZxCLOpTGSyEcUNWiPj0FdOa03oPdzOqWo8ouQBqOMW1JtytwmX1GdwpN+8KuWKMsdIBd3b6t7uSg58PZNyLg81GF3QlNLVEGGxxZ5Z+tGe4GxHSweRoY+vT4Z/XvNoFTTi3VtXDTz0Vzt7fA24L/BbGb8FtpSU1BBRy5k72bhNtCMbgnpaWr0gqrSdGDYn+Hs7JpBDneNf8SqrbIyVx3qyFKbs/7VftlqAkrCt/PBjxu98MliaWV3Z6bJjzmYc8DcBIroWC+cP/MCX/w3XksrV4YiO7Qk4CWgVMpLqfJejfhIsQZ4QZ4L5A069xqRsXjwWfX76mG8raKBw8KJmoGQZMFuRJvI48/CCBvHikwpMOiEFBr+tmQzFqY9IC0hrcIw1kbDMDLsvqnSzEIlL7NG7znlQAwCBi4R6TNhXjyZhVWBN04HrcLoa0gvNJeZpIxOAC4sgocyFPfSyMjbtLLEBC+XzL3TJz1SmxjHwzwm95j7pkawEoTm7+2gXKcoLgWehEytQfgmnLyX7CbhtT0p6ZG/ZdCutUMOCRuhBE575YkLIpcnFg6GIenm7HmNzY+eAaNuF5sEkveXBs8Ge1VPAHFXJN55aUpIOOypTPJ4cMWyHWED9ay19w90ePr4MdHVxjDocCOxHAKIDr2gHFikaSMkxJxuQwre6igDDoQB2PoJLaYFTZz8laLKkyPS9hk3mVG199pfIa2HK6unPADQKPKcYjsvOTS3tCw2iq4ghuuwPcLJarbcOCQULCEs1SLWTL3RZ5PBJGk5gBbOT1M3TTxGRKnmHqVirpC wXI2rsAf l5VHiYJ0ZHWutqjE101SweE4LhqjZJXJh7y04rmzJkSSEE9ng5Xc6AqQUTfXKnQSsLsyc26+EO2ILPyoq7X4ON68Y2pKa3UQ4IsDl0nLUFQjYafJ/mjq3CTSIZzbxxbynfTyr7dHfXIIZvaWE950MHp3Zz8N9zb/qyXA4O+d/G863P8U= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: If mas->node is an MAS_START, there are three cases, and they all assign different values to mas->node and mas->offset. So there is no need to set them to a default value before updating. Update them directly to make them easier to understand and for better readability. Signed-off-by: Vernon Yang --- lib/maple_tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index e7dde4a1d6cb..16cdcf309e97 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1329,7 +1329,7 @@ static void mas_node_count(struct ma_state *mas, int count) * mas_start() - Sets up maple state for operations. * @mas: The maple state. * - * If mas->node == MAS_START, then set the min, max, depth, and offset to + * If mas->node == MAS_START, then set the min, max and depth to * defaults. * * Return: @@ -1343,22 +1343,22 @@ static inline struct maple_enode *mas_start(struct ma_state *mas) if (likely(mas_is_start(mas))) { struct maple_enode *root; - mas->node = MAS_NONE; mas->min = 0; mas->max = ULONG_MAX; mas->depth = 0; - mas->offset = 0; root = mas_root(mas); /* Tree with nodes */ if (likely(xa_is_node(root))) { mas->depth = 1; mas->node = mte_safe_root(root); + mas->offset = 0; return NULL; } /* empty tree */ if (unlikely(!root)) { + mas->node = MAS_NONE; mas->offset = MAPLE_NODE_SLOTS; return NULL; } From patchwork Tue Dec 20 14:26:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vernon Yang X-Patchwork-Id: 13077943 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 24E3BC4332F for ; Tue, 20 Dec 2022 14:26:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA4928E000A; Tue, 20 Dec 2022 09:26:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B547D8E0006; Tue, 20 Dec 2022 09:26:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A1D128E000A; Tue, 20 Dec 2022 09:26:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 9069D8E0006 for ; Tue, 20 Dec 2022 09:26:47 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 3EE861C64B5 for ; Tue, 20 Dec 2022 14:26:47 +0000 (UTC) X-FDA: 80262910854.14.6B073DA Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf26.hostedemail.com (Postfix) with ESMTP id 6FC28140007 for ; Tue, 20 Dec 2022 14:26:45 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=CKh2pvjJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.49 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=1671546405; 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:in-reply-to:references:references:dkim-signature; bh=k5pCjcE2QSizxYYpcp3Q7JX0pj7AbGWE8N5U6SKdhaY=; b=COlkXtwCwIv9KHYjURxMQu5svfe2KPLgzJCK+R+oRp8quejHXqUAFOlqUGqEssX6SiR71C nQTsAD3zPyGBm5Hmoy/0TMVeBmzfzeQsG2qFqPn2U1dRwNq4PaSS4Vg11aGgeMyAIOvvIo H3afXY1OPOwvzghmcMYMXEG6QAsjeeM= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=CKh2pvjJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of vernon2gm@gmail.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=vernon2gm@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671546405; a=rsa-sha256; cv=none; b=3PAc2C60fYKY1nLzs62ygtCut99HC1H/mCbwMGN7SqsIQ1rYIN+m7g2ZE8sf0PMg2pOWrh dnanalemuEXxv7ywhYsb9IAuSWTcjR2vcxGP9v04PRN3Jf+fBBw7l9bbldHr4jsjs6v0AE CX299EoWpqcxfebXahhkNg1wqa/fBkk= Received: by mail-pj1-f49.google.com with SMTP id o8-20020a17090a9f8800b00223de0364beso3845116pjp.4 for ; Tue, 20 Dec 2022 06:26:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k5pCjcE2QSizxYYpcp3Q7JX0pj7AbGWE8N5U6SKdhaY=; b=CKh2pvjJEKmz9XfYB+s2Lm4mMBVB5Bv2Os5YbA+gIrD7IqyqI3Ob93H9gszwSnJ9Kf sN2nuI9TfUNHyfeEs4jgD5rfza83LS4rzw8Hne8yskYfTNDothnvWNLAMLQHBC04ByWW doMsWmNEVsHtiSY0wJPVtlAA2ZvQGm2v2fRkvutJroEV3zppdmSd5rC8fzp3IC1nKqDL oOtoxI2NH7HRIX2WY6h6EsocwG5B2iiGUPOwcLa+0QHm11jjm/mcDkbTCV5nkfMwd4hq 3dAQg2580o2Bu0qySrLJycUJS2ObN1ZrF0X/Iy5NMT4PM/B2LovkVvjsOpyIc4i0lj5v WQZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k5pCjcE2QSizxYYpcp3Q7JX0pj7AbGWE8N5U6SKdhaY=; b=jyqREXzI3QdfZJffjNEmmIJX/cqhveGkD4CrNkArZqGfwPMxSSXQpAAHya85PRDUEI sFzHKYYhgpVMBYuRi6MxwE+40/qSOXlngyyRopvt+HZRG+G2Aw+dp25QvucS6okEgW6v HRzkMSUHiDp6tZbSTJszDIZaCkpcx5jlfgiD81AjFqzPpsyq3FXMEyQ830AapmO1H9WH gfca8/ltgV1lkfNcPWiOeau4NKSPL7AAFdnLBf83/PMccJTM4qBALG5qTjJLdU+gp/k/ ScoTrGBCxtmDABnBb3mPs3neZ1cbyhGHbZsWdLJynm4+SzleaYZgWrq/ksv9gMYhCslq KSBg== X-Gm-Message-State: AFqh2kphHjfhb3E/QSHQfx+N6mv+SlN+FI5QiHaXPVG2hgcS3MyiWlsj mhOuDZqzM2IF2bhoKGm6P+E= X-Google-Smtp-Source: AMrXdXtlURzlzqLwBRnEXi12q7aZoY+rMiK4Tn9hVg323qyMw/gVzTSdDNY/lWtEe2PfX2SIKLofkA== X-Received: by 2002:a17:902:bd87:b0:18c:1bc5:bd58 with SMTP id q7-20020a170902bd8700b0018c1bc5bd58mr13799535pls.9.1671546404436; Tue, 20 Dec 2022 06:26:44 -0800 (PST) Received: from vernon-pc.. ([114.231.52.81]) by smtp.gmail.com with ESMTPSA id ik11-20020a170902ab0b00b001897bfc9800sm9383398plb.53.2022.12.20.06.26.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 06:26:43 -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 8/8] maple_tree: refine mab_calc_split function Date: Tue, 20 Dec 2022 22:26:06 +0800 Message-Id: <20221220142606.1698836-9-vernon2gm@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221220142606.1698836-2-vernon2gm@gmail.com> References: <20221220142606.1698836-2-vernon2gm@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 6FC28140007 X-Stat-Signature: itm3g5mdqz4fasada6owr3gy3mcuru6o X-HE-Tag: 1671546405-530286 X-HE-Meta: U2FsdGVkX18hbKzvD7SGRcvwPIeJJVZSSfPj7Bi0MVT+CVx2Bw8sT9ciP4eB+axGzhqeV8i7ynevf7Bx5BBhmjPO2XHwDEQWk2ES23DwJ7kMcBdF4pYn6tXTCVNcOh7WHlMbvEZdSOtPgKKqu77Yz0j7hUDhmkbd9tXzu5/Mgwi7W9AJ6p6JyZLsUB76wtlxmCb/ZYPTk2MgkGp3UoqOkkumJiOZX0mbD/BYmY78dQjaKUx8pFfeg0iJ+c0u4KiP3Sy0hkP92QVjZQSVcFUqnGgtIzJ7MQe/1rt+TL8ZAFBv9DJWKswkYGSjUl+C6uGrKVNG6XRGxUqQih1Edtjixmo+4NQ8f2Js2HqcySo3/aMcj6hgsBkSvtS3oxy7VF05z0hAbjUlyOl9pHQPahNvxQu0ts9VHsVNzL2OsOo2uiBP6NoNn1MfRRX75oqMs4R4buSNrksHCxnS62DC6wVwG52psREiJUp4jl3sR4X1/SN6yA1NmpnGQEnlNgr0D9AB7XRCouHRN7zzMM2yBGliNMc4qAt9SkGSzJ2OejcFqi5DsZsKZPT/fxTiRmjk+rntbRkBd6k9gkEEcjbXxDEFM//UtooTYyjBUH2PyPXUStjVuQrBUZ0HN1OCP1pQTF7c7x/YJXlaTbVWnbsmK5JRAYIaOfRpKC2Rver2+w5GxpRq6r0lC+NtDaGEWJ1pj3aC3dPiQiLbxGxOAJ6H+XgPXcJSuPKM4UXlr68kmLcMxQqJbXY3OlzISEhgcla0lolWfeZBSntMcUHa+2iVXXuu92aNk9M7FkbOojTskg/q2PIHcxDarhKhPLnUeTRTQ2ze+tpEYkeTkr68edLvtjq6MLi84JxBcJrXNRmxn1DtLQJxcqah+3Io++8OVzRvP7zHoE3CDIQjnEi7nmk+x0T3QKbDNALRx5IFQThyI36RbWZyepfgoOEHqdKothSR8z0DeD+W+NP2CYY9/xHitZe ZloOWRkJ ysovslluSezftiNTl+vAS5Rh+nyqpzAROOIrpe8Nbf46c3n2rx2xF+ScFy/KzNESdpwnvSoakHgztR4+Ubo4XtGk2xKhnh9QhDJjv/kHjXEWL3F5uvkivKqCdFYQ3Fn42HRf06RziMiN16H4xcHz0xUXH0FH7ePss/xsSQNDJa+tN5BU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Invert the conditional judgment of the mid_split, to focus the return statement in the last statement, which is easier to understand and for better readability. Signed-off-by: Vernon Yang --- lib/maple_tree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 16cdcf309e97..d147669fb99c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1882,10 +1882,9 @@ static inline int mab_calc_split(struct ma_state *mas, /* Avoid ending a node on a NULL entry */ split = mab_no_null_split(bn, split, slot_count); - if (!(*mid_split)) - return split; - *mid_split = mab_no_null_split(bn, *mid_split, slot_count); + if (*mid_split) + *mid_split = mab_no_null_split(bn, *mid_split, slot_count); return split; }