linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/damon/reclaim: Use resource_size function on resource object
@ 2022-05-07  3:25 Jiapeng Chong
  2022-05-07 15:38 ` SeongJae Park
  0 siblings, 1 reply; 3+ messages in thread
From: Jiapeng Chong @ 2022-05-07  3:25 UTC (permalink / raw)
  To: sj; +Cc: akpm, linux-mm, linux-kernel, Jiapeng Chong, Abaci Robot

Fix the following coccicheck warnings:

./mm/damon/reclaim.c:241:30-33: WARNING: Suspicious code. resource_size
is maybe missing with res.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 mm/damon/reclaim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c
index f37c5d4b27fa..8efbfb24f3a1 100644
--- a/mm/damon/reclaim.c
+++ b/mm/damon/reclaim.c
@@ -238,7 +238,7 @@ static int walk_system_ram(struct resource *res, void *arg)
 {
 	struct damon_reclaim_ram_walk_arg *a = arg;
 
-	if (a->end - a->start < res->end - res->start) {
+	if (a->end - a->start < resource_size(res)) {
 		a->start = res->start;
 		a->end = res->end;
 	}
-- 
2.20.1.7.g153144c



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

end of thread, other threads:[~2022-05-09 10:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-07  3:25 [PATCH] mm/damon/reclaim: Use resource_size function on resource object Jiapeng Chong
2022-05-07 15:38 ` SeongJae Park
2022-05-09 10:13   ` Boehme, Markus

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