domain_page: handle NULL within unmap_domain_page() itself
authorHongyan Xia <hongyxia@amazon.com>
Wed, 13 May 2020 15:43:33 +0000 (16:43 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 15 May 2020 18:35:09 +0000 (19:35 +0100)
commit84c2b2a81ab8aa0a14f50660ed7a214beae5a20f
treef7a707541b3fba26c179ea1737cfb9a69ba7a6d8
parent90b1701905dd0cbb7efe525b1bf92007fe818b60
domain_page: handle NULL within unmap_domain_page() itself

The macro version UNMAP_DOMAIN_PAGE() does both NULL checking and
variable clearing. Move NULL checking into the function itself so that
the semantics is consistent with other similar constructs like XFREE().
This also eases the use unmap_domain_page() in error handling paths,
where we only care about NULL checking but not about variable clearing.

Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
Reviewed-by: Wei Liu <wl@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/mm.c
xen/arch/x86/domain_page.c
xen/include/xen/domain_page.h