]> git.baikalelectronics.ru Git - kernel.git/commit
include/linux/mmdebug.h: make VM_WARN* non-rvals
authorMichal Hocko <mhocko@kernel.org>
Thu, 5 Apr 2018 23:25:30 +0000 (16:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Apr 2018 04:36:27 +0000 (21:36 -0700)
commit7df42f7681cd416648fdf20070781a5d3ba31e43
treecad7912bd078096ca33893be54443fb9b97676f5
parent655b2b34763b37020079310c106150e64d82636d
include/linux/mmdebug.h: make VM_WARN* non-rvals

At present the construct

if (VM_WARN(...))

will compile OK with CONFIG_DEBUG_VM=y and will fail with
CONFIG_DEBUG_VM=n.  The reason is that VM_{WARN,BUG}* have always been
special wrt.  {WARN/BUG}* and never generate any code when DEBUG_VM is
disabled.  So we cannot really use it in conditionals.

We considered changing things so that this construct works in both cases
but that might cause unwanted code generation with CONFIG_DEBUG_VM=n.
It is safer and simpler to make the build fail in both cases.

[akpm@linux-foundation.org: changelog]
Signed-off-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/mmdebug.h