Commit 2e14a8d3 authored by Jiapeng Chong's avatar Jiapeng Chong Committed by Andrew Morton

mm/damon/reclaim: use resource_size function on resource object

Fix the following coccicheck warnings:

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

Link: https://lkml.kernel.org/r/20220507032512.129598-1-jiapeng.chong@linux.alibaba.comSigned-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
Reviewed-by: default avatarSeongJae Park <sj@kernel.org>
Cc: "Boehme, Markus" <markubo@amazon.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent c8db8c26
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment