mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexey Romanov <avromanov@sberdevices.ru>
To: <minchan@kernel.org>, <senozhatsky@chromium.org>,
	<akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	<kernel@sberdevices.ru>,
	Alexey Romanov <avromanov@sberdevices.ru>
Subject: [PATCH v1 1/2] mm/zsmalloc: use ARRAY_SIZE in isolate_zspage()
Date: Tue, 16 May 2023 12:50:28 +0300	[thread overview]
Message-ID: <20230516095029.49036-1-avromanov@sberdevices.ru> (raw)

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


             reply	other threads:[~2023-05-16  9:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16  9:50 Alexey Romanov [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230516095029.49036-1-avromanov@sberdevices.ru \
    --to=avromanov@sberdevices.ru \
    --cc=akpm@linux-foundation.org \
    --cc=kernel@sberdevices.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=senozhatsky@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®