OSDN Git Service

mm: Handle 0 flags in _calc_vm_trans() macro
authorJan Kara <jack@suse.cz>
Fri, 3 Nov 2017 11:21:21 +0000 (12:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2017 09:07:29 +0000 (10:07 +0100)
commit2850c3ec0d25a4f729bd7f2212e178c9303e697a
tree6dbd608425d1ded517c00871baeeb8f5a59dc22d
parent18498f1c7089035faba2bc9ba64c5c96542ae0c4
mm: Handle 0 flags in _calc_vm_trans() macro

[ Upstream commit 592e254502041f953e84d091eae2c68cba04c10b ]

_calc_vm_trans() does not handle the situation when some of the passed
flags are 0 (which can happen if these VM flags do not make sense for
the architecture). Improve the _calc_vm_trans() macro to return 0 in
such situation. Since all passed flags are constant, this does not add
any runtime overhead.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/mman.h