@@ -85,13 +85,12 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
struct compat_mem_access_op mao;
struct compat_mem_acquire_resource mar;
} cmp;
+ xen_pfn_t *space;
set_xen_guest_handle(nat.hnd, COMPAT_ARG_XLAT_VIRT_BASE);
split = 0;
switch ( op )
{
- xen_pfn_t *space;
-
case XENMEM_increase_reservation:
case XENMEM_decrease_reservation:
case XENMEM_populate_physmap:
@@ -401,6 +401,13 @@ static int domain_teardown(struct domain *d)
{
struct vcpu *v;
int rc;
+ enum {
+ PROG_none,
+ PROG_gnttab_mappings,
+ PROG_vcpu_teardown,
+ PROG_arch_teardown,
+ PROG_done,
+ };
BUG_ON(!d->is_dying);
@@ -435,14 +442,6 @@ static int domain_teardown(struct domain *d)
case PROG_vcpu_ ## x: \
v = d->teardown.vcpu
- enum {
- PROG_none,
- PROG_gnttab_mappings,
- PROG_vcpu_teardown,
- PROG_arch_teardown,
- PROG_done,
- };
-
case PROG_none:
BUILD_BUG_ON(PROG_none != 0);
Declarations between a switch statement guard and before any case label are unreachable code, and hence violate Rule 2.1: "A project shall not contain unreachable code". Therefore the variable declarations are moved in the smallest enclosing scope, near other variable definitions. Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com> --- xen/common/compat/memory.c | 3 +-- xen/common/domain.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-)