public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] mm/zsmalloc: use ARRAY_SIZE in isolate_zspage()
@ 2023-05-16  9:50 Alexey Romanov
  2023-05-16  9:50 ` [PATCH v1 2/2] mm/zsmalloc: get rid of PAGE_MASK Alexey Romanov
  2023-05-16  9:53 ` [PATCH v1 1/2] mm/zsmalloc: use ARRAY_SIZE in isolate_zspage() Sergey Senozhatsky
  0 siblings, 2 replies; 6+ messages in thread
From: Alexey Romanov @ 2023-05-16  9:50 UTC (permalink / raw)
  To: minchan, senozhatsky, akpm; +Cc: linux-mm, linux-kernel, kernel, Alexey Romanov

Better not to use hardcoded constants.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 702bc3fd687a..f23c2da55368 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1888,7 +1888,7 @@ static struct zspage *isolate_zspage(struct size_class *class, bool source)
 		fg[1] = ZS_ALMOST_EMPTY;
 	}
 
-	for (i = 0; i < 2; i++) {
+	for (i = 0; i < ARRAY_SIZE(fg); i++) {
 		zspage = list_first_entry_or_null(&class->fullness_list[fg[i]],
 							struct zspage, list);
 		if (zspage) {
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-16 12:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16  9:50 [PATCH v1 1/2] mm/zsmalloc: use ARRAY_SIZE in isolate_zspage() Alexey Romanov
2023-05-16  9:50 ` [PATCH v1 2/2] mm/zsmalloc: get rid of PAGE_MASK Alexey Romanov
2023-05-16  9:56   ` Sergey Senozhatsky
2023-05-16  9:53 ` [PATCH v1 1/2] mm/zsmalloc: use ARRAY_SIZE in isolate_zspage() Sergey Senozhatsky
2023-05-16 10:11   ` Alexey Romanov
2023-05-16 12:29     ` Sergey Senozhatsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox