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; } /*