diff mbox series

[1/4] x8&/mm: fix IS_LnE_ALIGNED() to comply with Misra Rule 20.7

Message ID 20241119103444.23296-2-roger.pau@citrix.com (mailing list archive)
State New
Headers show
Series x86/misra: fix remaining violations of rule 20.7 | expand

Commit Message

Roger Pau Monné Nov. 19, 2024, 10:34 a.m. UTC
While not strictly needed to guarantee operator precedence is as expected, add
the parentheses to comply with Misra Rule 20.7.

No functional change intended.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Fixes: 5b52e1b0436f ('x86/mm: skip super-page alignment checks for non-present entries')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Frediano Ziglio Nov. 19, 2024, 10:52 a.m. UTC | #1
On Tue, Nov 19, 2024 at 10:35 AM Roger Pau Monne <roger.pau@citrix.com> wrote:
>
> While not strictly needed to guarantee operator precedence is as expected, add
> the parentheses to comply with Misra Rule 20.7.
>
> No functional change intended.
>
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Fixes: 5b52e1b0436f ('x86/mm: skip super-page alignment checks for non-present entries')
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  xen/arch/x86/mm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
> index 494c14e80ff9..fa21903eb25a 100644
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -5498,7 +5498,7 @@ int map_pages_to_xen(
>   * be INVALID_MFN, since alignment is only relevant for present entries.
>   */
>  #define IS_LnE_ALIGNED(v, m, n) ({                              \
> -    mfn_t m_ = m;                                               \
> +    mfn_t m_ = (m);                                             \
>                                                                  \
>      ASSERT(!mfn_eq(m_, INVALID_MFN));                           \
>      IS_ALIGNED(PFN_DOWN(v) | mfn_x(m_),                         \

Minor, typo in subject: x8& -> x86

Frediano
Jan Beulich Nov. 19, 2024, 11:06 a.m. UTC | #2
On 19.11.2024 11:34, Roger Pau Monne wrote:
> While not strictly needed to guarantee operator precedence is as expected, add
> the parentheses to comply with Misra Rule 20.7.
> 
> No functional change intended.
> 
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Fixes: 5b52e1b0436f ('x86/mm: skip super-page alignment checks for non-present entries')
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
Roger Pau Monné Nov. 19, 2024, 2:10 p.m. UTC | #3
On Tue, Nov 19, 2024 at 10:52:26AM +0000, Frediano Ziglio wrote:
> On Tue, Nov 19, 2024 at 10:35 AM Roger Pau Monne <roger.pau@citrix.com> wrote:
> >
> > While not strictly needed to guarantee operator precedence is as expected, add
> > the parentheses to comply with Misra Rule 20.7.
> >
> > No functional change intended.
> >
> > Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > Fixes: 5b52e1b0436f ('x86/mm: skip super-page alignment checks for non-present entries')
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> >  xen/arch/x86/mm.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
> > index 494c14e80ff9..fa21903eb25a 100644
> > --- a/xen/arch/x86/mm.c
> > +++ b/xen/arch/x86/mm.c
> > @@ -5498,7 +5498,7 @@ int map_pages_to_xen(
> >   * be INVALID_MFN, since alignment is only relevant for present entries.
> >   */
> >  #define IS_LnE_ALIGNED(v, m, n) ({                              \
> > -    mfn_t m_ = m;                                               \
> > +    mfn_t m_ = (m);                                             \
> >                                                                  \
> >      ASSERT(!mfn_eq(m_, INVALID_MFN));                           \
> >      IS_ALIGNED(PFN_DOWN(v) | mfn_x(m_),                         \
> 
> Minor, typo in subject: x8& -> x86

Nice, that's what you get when you press shift + 6 on a Spanish
keyboard.  Hope it can be adjusted at commit.

Thanks.
diff mbox series

Patch

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 494c14e80ff9..fa21903eb25a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5498,7 +5498,7 @@  int map_pages_to_xen(
  * be INVALID_MFN, since alignment is only relevant for present entries.
  */
 #define IS_LnE_ALIGNED(v, m, n) ({                              \
-    mfn_t m_ = m;                                               \
+    mfn_t m_ = (m);                                             \
                                                                 \
     ASSERT(!mfn_eq(m_, INVALID_MFN));                           \
     IS_ALIGNED(PFN_DOWN(v) | mfn_x(m_),                         \