]> git.baikalelectronics.ru Git - kernel.git/commit
damon: vaddr-test: tweak code to make the logic clearer
authorXiaomeng Tong <xiam0nd.tong@gmail.com>
Fri, 29 Apr 2022 21:37:00 +0000 (14:37 -0700)
committerakpm <akpm@linux-foundation.org>
Fri, 29 Apr 2022 21:37:00 +0000 (14:37 -0700)
commit7d2ab47c8393ff2c5ae6a2bed1c88909f0833723
tree818a77e9c466132b1a266e510712943967e8208d
parent8de7ad919d7d2ef1d2bf8420e8a85e493f44d946
damon: vaddr-test: tweak code to make the logic clearer

Move these two lines into the damon_for_each_region loop, it is always for
testing the last region.  And also avoid to use a list iterator 'r'
outside the loop which is considered harmful[1].

[1]:  https://lkml.org/lkml/2022/2/17/1032

Link: https://lkml.kernel.org/r/20220328115252.31675-1-xiam0nd.tong@gmail.com
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/vaddr-test.h