]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm: remove variable to avoid shadowing
authorNicola Vetrini <nicola.vetrini@bugseng.com>
Mon, 31 Jul 2023 13:06:23 +0000 (15:06 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 31 Jul 2023 13:06:23 +0000 (15:06 +0200)
The local variable 'p2mt' shadows a declaration of the same variable
in the enclosing scope, but removing the inner declaration
does not alter the semantics ('p2mt' is an output for the get_gfn
call later on) and this resolves a violation of
MISRA C:2012 Rule 5.3.

No functional changes.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm/p2m.c

index 714358f953f271f2733a17b74ac158356177e388..f6df35767a2393506eff3511f74e267d1ba5f4ef 100644 (file)
@@ -2439,8 +2439,6 @@ int xenmem_add_to_physmap_one(
 
     case XENMAPSPACE_gmfn:
     {
-        p2m_type_t p2mt;
-
         gfn = idx;
         mfn = get_gfn_unshare(d, gfn, &p2mt);
         /* If the page is still shared, exit early */