From patchwork Sun Nov 13 00:56:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13041393 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 6AEA2C433FE for ; Sun, 13 Nov 2022 00:56:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B1C906B0071; Sat, 12 Nov 2022 19:56:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ACC7A6B0072; Sat, 12 Nov 2022 19:56:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BB3E8E0001; Sat, 12 Nov 2022 19:56:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 907056B0071 for ; Sat, 12 Nov 2022 19:56:46 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 448E1A07B5 for ; Sun, 13 Nov 2022 00:56:46 +0000 (UTC) X-FDA: 80126604012.23.950EB9C Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by imf12.hostedemail.com (Postfix) with ESMTP id D5DEE40002 for ; Sun, 13 Nov 2022 00:56:44 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id s12so12508635edd.5 for ; Sat, 12 Nov 2022 16:56:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W0SikHTdUbXQLGro61wDie+oPkKhps+RKTwvHMmIsLg=; b=mw93TmEeH1gUrFjBnB2pV2QBDf+ZR6rzwh3OIkxUlRatK4s7HhNKVu7jXkoEG09aTI P0f8HQJhWzi4/70jiM86jX48e4C0NlM+4mMwlHpBlY0CCHhwjWCfghuNrhdqnS0bb71Z aBn1hfjfVeIPNv8JtPUW28yCoaIFakVMmzyOD97hJ25M5B15btMtjPK5ArTH+EjbCKTI CYxaNhakK1gZCX0CkGti6gNXeM8B+rkzZNOCw2vhMW1F/37bUPkyR2IrlXaxLcxTXZrO Y94Acve50lqRZ3eBoKOkVHEQjrTeyaqk/uZLWoOvkMZjudhlccgnHQR+7zQK25PjLoW8 5CIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W0SikHTdUbXQLGro61wDie+oPkKhps+RKTwvHMmIsLg=; b=6+wlmO4CBKKgoCyO0RR4fi4d4neP7eY0iNc+mRlreqEPbIXSfzxqQUinvoZMkCdcya BFJBQG6FYuKgiJrIkCw+RWDg2pAFntpWB2pzO4E23tSzhyDAPIzWPY6gmXzNZ8xTxeyZ 9Yigor3YKkTJb/sRmzMzMuoznHKSE05wWWbn4/t5xfnGsCPMFdN3akAxvJBHoeLNK8EP EviY+skxZ2OyKs8BTkPn5MnHasVTfVllPO6u+eokdt+vowcGfg9O6YqhMHSM9KSnNsep wDVzFAi3kddT2eyl3nUQK+35u2/vIX0OhaL0ruz+Pur+V3PFL8dtXs1t4Icc4g22Zx6G G0ZA== X-Gm-Message-State: ANoB5pljRK/sKSlswnBCeTPE6RQA4Xk74SahArjB3HVh9eKvoYST0H8G cWz3tk6SyEXRPishbBLwwMI= X-Google-Smtp-Source: AA0mqf6tPkb9QZNuvbeDhu+w2qQFk0kdlva83w34GrD+f50KhRRKfHfA71q565q1rM7fvZj/AKdyJA== X-Received: by 2002:a50:9eaa:0:b0:461:86b7:7627 with SMTP id a39-20020a509eaa000000b0046186b77627mr6974061edf.180.1668301003339; Sat, 12 Nov 2022 16:56:43 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id p25-20020a17090653d900b00779a605c777sm2398728ejo.192.2022.11.12.16.56.42 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Nov 2022 16:56:42 -0800 (PST) From: Wei Yang To: Liam.Howlett@oracle.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang , "Liam R . Howlett" Subject: [PATCH] maple_tree: not necessary to filter MAPLE_PARENT_ROOT since it is not a root Date: Sun, 13 Nov 2022 00:56:18 +0000 Message-Id: <20221113005618.29679-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668301004; a=rsa-sha256; cv=none; b=SjTMkSXvbDSh/GOZBzpwe4XzEtexuOe8cknUrQxXEHqAc+23zAqtB/tmnHGqbyZoK5AO5Q mBotIC+ksjrVampLkSws1c+1+LVP/aMsj7EkHv8qiYOp5EgVmsJdqj2n/huiVUuIPWuUA5 5q8C8MtTSt2WO/V2zLWjJBRCAgkfUbQ= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mw93TmEe; spf=pass (imf12.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=richard.weiyang@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=1668301004; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=W0SikHTdUbXQLGro61wDie+oPkKhps+RKTwvHMmIsLg=; b=Wj8x8LxOojfyeL8zjCnl2mjO9cvbM8PGnYP0lRjt1+7GjlCRR6LC23IQRN4bzpmSIwrlz7 LkMiJNElbPOetYT/Zs9ecrDcaJjOqN5Ozr/Hm+cnNKD4qs9b5MCqGg60nqsABUh+LYplnw 8PSgteLCoKR2p2T3eP53b7AJTNu1Q6U= X-Stat-Signature: qekeqcz8q5sr79ctpmdmuiejwwx4syn4 X-Rspamd-Queue-Id: D5DEE40002 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mw93TmEe; spf=pass (imf12.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1668301004-706533 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: Root node is return at the beginning, so we are sure bit 0 is not set. Signed-off-by: Wei Yang CC: Liam R. Howlett --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 9aad98c24f3e..f8c4755e7c75 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -436,7 +436,7 @@ enum maple_type mte_parent_enum(struct maple_enode *p_enode, return 0; /* Validated in the caller. */ p_type &= MAPLE_NODE_MASK; - p_type = p_type & ~(MAPLE_PARENT_ROOT | mte_parent_slot_mask(p_type)); + p_type = p_type & ~mte_parent_slot_mask(p_type); switch (p_type) { case MAPLE_PARENT_RANGE64: /* or MAPLE_PARENT_ARANGE64 */