diff options
author | Jiapeng Chong <[email protected]> | 2022-05-12 20:23:07 -0700 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2022-05-13 07:20:18 -0700 |
commit | 2e14a8d3bbccf22a807c012ff6e7c2f307600e4a (patch) | |
tree | b0c1aae2298e662a5598fe0b17c1b6f3fd576d99 | |
parent | c8db8c2628afc7088a43de3f7cfbcc2ef1f182f7 (diff) |
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/[email protected]
Signed-off-by: Jiapeng Chong <[email protected]>
Reported-by: Abaci Robot <[email protected]>
Reviewed-by: SeongJae Park <[email protected]>
Cc: "Boehme, Markus" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r-- | mm/damon/reclaim.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |