]> git.baikalelectronics.ru Git - kernel.git/commit
mm/damon: modify damon_rand() macro to static inline function
authorXin Hao <xhao@linux.alibaba.com>
Fri, 14 Jan 2022 22:09:56 +0000 (14:09 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 15 Jan 2022 14:30:32 +0000 (16:30 +0200)
commit8064f6547ac584e3164ddd00ba792a6a207a3959
tree7e174e17c43fb2e7d2cdd9ca0bd064aa746b6ed1
parentbfd9273945e5cc85dafa3d58ab973a69715440d2
mm/damon: modify damon_rand() macro to static inline function

damon_rand() cannot be implemented as a macro.

Example:
damon_rand(a++, b);

The value of 'a' will be incremented twice, This is obviously
unreasonable, So there fix it.

Link: https://lkml.kernel.org/r/110ffcd4e420c86c42b41ce2bc9f0fe6a4f32cd3.1638795127.git.xhao@linux.alibaba.com
Fixes: c44064c25c90 ("mm/damon: adaptively adjust regions")
Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/damon.h