x86/shadow: Reposition sh_remove_write_access_from_sl1p()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 21 May 2020 08:45:27 +0000 (09:45 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 25 May 2020 15:37:48 +0000 (16:37 +0100)
commit354e8318d5a9b6f32fbd3c01d1a9f1970007010b
treedc64fb082bfac44c18a16e15d82a866ba16f5afe
parentb4d01ede23847bed9471ca0b7071394aef693a1a
x86/shadow: Reposition sh_remove_write_access_from_sl1p()

When compiling with SHOPT_OUT_OF_SYNC disabled, the build fails with:

  common.c:41:12: error: ‘sh_remove_write_access_from_sl1p’ declared ‘static’ but never defined [-Werror=unused-function]
   static int sh_remove_write_access_from_sl1p(struct domain *d, mfn_t gmfn,
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

due to an unguarded forward declaration.

It turns out there is no need to forward declare
sh_remove_write_access_from_sl1p() to begin with, so move it to just ahead of
its first user, which is within a larger #ifdef'd SHOPT_OUT_OF_SYNC block.

Fix up for style while moving it.  No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/shadow/common.c