[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210619093151.1492174-2-linmiaohe@huawei.com>
Date: Sat, 19 Jun 2021 17:31:46 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: <akpm@...ux-foundation.org>
CC: <vitalywool@...il.com>, <linux-kernel@...r.kernel.org>,
<linux-mm@...ck.org>, <linmiaohe@...wei.com>
Subject: [PATCH 1/6] mm/z3fold: define macro NCHUNKS as TOTAL_CHUNKS - ZHDR_CHUNKS
To improve the code readability, we could define macro NCHUNKS as
TOTAL_CHUNKS - ZHDR_CHUNKS. No functional change intended.
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
mm/z3fold.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/z3fold.c b/mm/z3fold.c
index 56321bf37d56..04d0e493bd2e 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -62,7 +62,7 @@
#define ZHDR_SIZE_ALIGNED round_up(sizeof(struct z3fold_header), CHUNK_SIZE)
#define ZHDR_CHUNKS (ZHDR_SIZE_ALIGNED >> CHUNK_SHIFT)
#define TOTAL_CHUNKS (PAGE_SIZE >> CHUNK_SHIFT)
-#define NCHUNKS ((PAGE_SIZE - ZHDR_SIZE_ALIGNED) >> CHUNK_SHIFT)
+#define NCHUNKS (TOTAL_CHUNKS - ZHDR_CHUNKS)
#define BUDDY_MASK (0x3)
#define BUDDY_SHIFT 2
--
2.23.0
Powered by blists - more mailing lists