diff mbox series

[XEN,3/4] x86/mm: mechanically rename variable to avoid shadowing

Message ID 62f4a9e7a19b37c970e52f138a6eeb8f7363b7bc.1690449587.git.nicola.vetrini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series address violations of MISRA C:2012 Rule 5.3 on x86 | expand

Commit Message

Nicola Vetrini July 27, 2023, 10:45 a.m. UTC
The rename s/p2mt/t/ is done to avoid shadowing the same declaration
in the enclosing scope.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
Is the semantics of the function altered if the inner declaration
is removed entirely?
---
 xen/arch/x86/mm/p2m.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jan Beulich July 27, 2023, 3:34 p.m. UTC | #1
On 27.07.2023 12:48, Nicola Vetrini wrote:
> The rename s/p2mt/t/ is done to avoid shadowing the same declaration
> in the enclosing scope.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
> Is the semantics of the function altered if the inner declaration
> is removed entirely?

No, that's what should be done. It's an output only for get_gfn().

Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 714358f953..fa9f7616e8 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2439,12 +2439,12 @@  int xenmem_add_to_physmap_one(
 
     case XENMAPSPACE_gmfn:
     {
-        p2m_type_t p2mt;
+        p2m_type_t t;
 
         gfn = idx;
-        mfn = get_gfn_unshare(d, gfn, &p2mt);
+        mfn = get_gfn_unshare(d, gfn, &t);
         /* If the page is still shared, exit early */
-        if ( p2m_is_shared(p2mt) )
+        if ( p2m_is_shared(t) )
         {
             put_gfn(d, gfn);
             return -ENOMEM;