diff mbox series

[1/7] x86/p2m: Add braces for better code clarity

Message ID 2e6e4f07b9e8f50ae65697c8644995aa4851cdac.1713990376.git.w1benny@gmail.com (mailing list archive)
State Superseded
Headers show
Series x86: Make MAX_ALTP2M configurable | expand

Commit Message

Petr Beneš April 24, 2024, 8:41 p.m. UTC
From: Petr Beneš <w1benny@gmail.com>

No functional change.

Signed-off-by: Petr Beneš <w1benny@gmail.com>
---
 xen/arch/x86/mm/p2m.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jan Beulich April 25, 2024, 6:21 a.m. UTC | #1
On 24.04.2024 22:41, Petr Beneš wrote:
> From: Petr Beneš <w1benny@gmail.com>
> 
> No functional change.
> 
> Signed-off-by: Petr Beneš <w1benny@gmail.com>

Hmm. I don't really mind the extra braces, but I also don't really see a need.
IOW this is not an objection, but it'll want to be someone else (if anyone) to
ack this.

Jan

> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -106,6 +106,7 @@ void p2m_change_entry_type_global(struct domain *d,
>          unsigned int i;
>  
>          for ( i = 0; i < MAX_ALTP2M; i++ )
> +        {
>              if ( d->arch.altp2m_eptp[i] != mfn_x(INVALID_MFN) )
>              {
>                  struct p2m_domain *altp2m = d->arch.altp2m_p2m[i];
> @@ -114,6 +115,7 @@ void p2m_change_entry_type_global(struct domain *d,
>                  change_entry_type_global(altp2m, ot, nt);
>                  p2m_unlock(altp2m);
>              }
> +        }
>      }
>  
>      p2m_unlock(hostp2m);
> @@ -139,6 +141,7 @@ void p2m_memory_type_changed(struct domain *d)
>          unsigned int i;
>  
>          for ( i = 0; i < MAX_ALTP2M; i++ )
> +        {
>              if ( d->arch.altp2m_eptp[i] != mfn_x(INVALID_MFN) )
>              {
>                  struct p2m_domain *altp2m = d->arch.altp2m_p2m[i];
> @@ -147,6 +150,7 @@ void p2m_memory_type_changed(struct domain *d)
>                  _memory_type_changed(altp2m);
>                  p2m_unlock(altp2m);
>              }
> +        }
>      }
>  
>      p2m_unlock(hostp2m);
Petr Beneš April 25, 2024, 8:41 a.m. UTC | #2
On Thu, Apr 25, 2024 at 8:21 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 24.04.2024 22:41, Petr Beneš wrote:
> > From: Petr Beneš <w1benny@gmail.com>
> >
> > No functional change.
> >
> > Signed-off-by: Petr Beneš <w1benny@gmail.com>
>
> Hmm. I don't really mind the extra braces, but I also don't really see a need.
> IOW this is not an objection, but it'll want to be someone else (if anyone) to
> ack this.
>
> Jan
>
> > --- a/xen/arch/x86/mm/p2m.c
> > +++ b/xen/arch/x86/mm/p2m.c
> > @@ -106,6 +106,7 @@ void p2m_change_entry_type_global(struct domain *d,
> >          unsigned int i;
> >
> >          for ( i = 0; i < MAX_ALTP2M; i++ )
> > +        {
> >              if ( d->arch.altp2m_eptp[i] != mfn_x(INVALID_MFN) )
> >              {
> >                  struct p2m_domain *altp2m = d->arch.altp2m_p2m[i];
> > @@ -114,6 +115,7 @@ void p2m_change_entry_type_global(struct domain *d,
> >                  change_entry_type_global(altp2m, ot, nt);
> >                  p2m_unlock(altp2m);
> >              }
> > +        }
> >      }
> >
> >      p2m_unlock(hostp2m);
> > @@ -139,6 +141,7 @@ void p2m_memory_type_changed(struct domain *d)
> >          unsigned int i;
> >
> >          for ( i = 0; i < MAX_ALTP2M; i++ )
> > +        {
> >              if ( d->arch.altp2m_eptp[i] != mfn_x(INVALID_MFN) )
> >              {
> >                  struct p2m_domain *altp2m = d->arch.altp2m_p2m[i];
> > @@ -147,6 +150,7 @@ void p2m_memory_type_changed(struct domain *d)
> >                  _memory_type_changed(altp2m);
> >                  p2m_unlock(altp2m);
> >              }
> > +        }
> >      }
> >
> >      p2m_unlock(hostp2m);
>

I should have specified that it builds on commit
5205bda5f11cc03ca62ad2bb6c34bf738bbb3247, which did some coding style
cleanup and added braces to several places too, but missed these two.
Stefano Stabellini April 25, 2024, 11:38 p.m. UTC | #3
On Wed, 24 Apr 2024, Petr Beneš wrote:
> From: Petr Beneš <w1benny@gmail.com>
> 
> No functional change.
> 
> Signed-off-by: Petr Beneš <w1benny@gmail.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
diff mbox series

Patch

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index ce742c12e0..eb7996170d 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -106,6 +106,7 @@  void p2m_change_entry_type_global(struct domain *d,
         unsigned int i;
 
         for ( i = 0; i < MAX_ALTP2M; i++ )
+        {
             if ( d->arch.altp2m_eptp[i] != mfn_x(INVALID_MFN) )
             {
                 struct p2m_domain *altp2m = d->arch.altp2m_p2m[i];
@@ -114,6 +115,7 @@  void p2m_change_entry_type_global(struct domain *d,
                 change_entry_type_global(altp2m, ot, nt);
                 p2m_unlock(altp2m);
             }
+        }
     }
 
     p2m_unlock(hostp2m);
@@ -139,6 +141,7 @@  void p2m_memory_type_changed(struct domain *d)
         unsigned int i;
 
         for ( i = 0; i < MAX_ALTP2M; i++ )
+        {
             if ( d->arch.altp2m_eptp[i] != mfn_x(INVALID_MFN) )
             {
                 struct p2m_domain *altp2m = d->arch.altp2m_p2m[i];
@@ -147,6 +150,7 @@  void p2m_memory_type_changed(struct domain *d)
                 _memory_type_changed(altp2m);
                 p2m_unlock(altp2m);
             }
+        }
     }
 
     p2m_unlock(hostp2m);