lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230516095029.49036-1-avromanov@sberdevices.ru>
Date:   Tue, 16 May 2023 12:50:28 +0300
From:   Alexey Romanov <avromanov@...rdevices.ru>
To:     <minchan@...nel.org>, <senozhatsky@...omium.org>,
        <akpm@...ux-foundation.org>
CC:     <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        <kernel@...rdevices.ru>, Alexey Romanov <avromanov@...rdevices.ru>
Subject: [PATCH v1 1/2] mm/zsmalloc: use ARRAY_SIZE in isolate_zspage()

Better not to use hardcoded constants.

Signed-off-by: Alexey Romanov <avromanov@...rdevices.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ