From patchwork Sat Feb 19 09:25:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12752176 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 C10ACC433FE for ; Sat, 19 Feb 2022 09:26:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D01E6B0083; Sat, 19 Feb 2022 04:26:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 55AF86B0085; Sat, 19 Feb 2022 04:26:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 420736B0087; Sat, 19 Feb 2022 04:26:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0005.hostedemail.com [216.40.44.5]) by kanga.kvack.org (Postfix) with ESMTP id 2FF376B0083 for ; Sat, 19 Feb 2022 04:26:28 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E212995192 for ; Sat, 19 Feb 2022 09:26:27 +0000 (UTC) X-FDA: 79158998814.19.4CB2299 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf23.hostedemail.com (Postfix) with ESMTP id 2E742140003 for ; Sat, 19 Feb 2022 09:26:27 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4K133n25lYzbbZ2; Sat, 19 Feb 2022 17:21:57 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Sat, 19 Feb 2022 17:26:22 +0800 From: Miaohe Lin To: CC: , , , Subject: [PATCH 9/9] mm/z3fold: remove unneeded return value of z3fold_compact_page() Date: Sat, 19 Feb 2022 17:25:33 +0800 Message-ID: <20220219092533.12596-10-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220219092533.12596-1-linmiaohe@huawei.com> References: <20220219092533.12596-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 2E742140003 X-Rspam-User: Authentication-Results: imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Stat-Signature: a41sw6fjtef8enfbe5y34g3y58zx4w9e X-HE-Tag: 1645262787-915296 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: Remove the unneeded return value of z3fold_compact_page() as it's never checked. Signed-off-by: Miaohe Lin Acked-by: Souptick Joarder --- mm/z3fold.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 83b5a3514427..db41b4227ec7 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -746,18 +746,18 @@ static struct z3fold_header *compact_single_buddy(struct z3fold_header *zhdr) #define BIG_CHUNK_GAP 3 /* Has to be called with lock held */ -static int z3fold_compact_page(struct z3fold_header *zhdr) +static void z3fold_compact_page(struct z3fold_header *zhdr) { struct page *page = virt_to_page(zhdr); if (test_bit(MIDDLE_CHUNK_MAPPED, &page->private)) - return 0; /* can't move middle chunk, it's used */ + return; /* can't move middle chunk, it's used */ if (unlikely(PageIsolated(page))) - return 0; + return; if (zhdr->middle_chunks == 0) - return 0; /* nothing to compact */ + return; /* nothing to compact */ if (zhdr->first_chunks == 0 && zhdr->last_chunks == 0) { /* move to the beginning */ @@ -766,7 +766,7 @@ static int z3fold_compact_page(struct z3fold_header *zhdr) zhdr->middle_chunks = 0; zhdr->start_middle = 0; zhdr->first_num++; - return 1; + return; } /* @@ -778,7 +778,6 @@ static int z3fold_compact_page(struct z3fold_header *zhdr) BIG_CHUNK_GAP) { mchunk_memmove(zhdr, zhdr->first_chunks + ZHDR_CHUNKS); zhdr->start_middle = zhdr->first_chunks + ZHDR_CHUNKS; - return 1; } else if (zhdr->last_chunks != 0 && zhdr->first_chunks == 0 && TOTAL_CHUNKS - (zhdr->last_chunks + zhdr->start_middle + zhdr->middle_chunks) >= @@ -787,10 +786,7 @@ static int z3fold_compact_page(struct z3fold_header *zhdr) zhdr->middle_chunks; mchunk_memmove(zhdr, new_start); zhdr->start_middle = new_start; - return 1; } - - return 0; } static void do_compact_page(struct z3fold_header *zhdr, bool locked)