Skip to content
Commit 70ff0aee authored by Xin Hao's avatar Xin Hao Committed by Hailong Tu
Browse files

UPSTREAM: 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: b9a6ac4e ("mm/damon: adaptively adjust regions")
Signed-off-by: default avatarXin Hao <xhao@linux.alibaba.com>
Reported-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: default avatarSeongJae Park <sj@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit 234d6873)

Bug: 228223814
Signed-off-by: default avatarHailong Tu <tuhailong@oppo.com>
Change-Id: Idcc316e6f582959254111fb160d04875d235c306
parent 3ecd29b5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment