]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm: fix IS_LnE_ALIGNED() to comply with Misra Rule 20.7
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 19 Nov 2024 10:34:41 +0000 (11:34 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 19 Nov 2024 19:53:51 +0000 (19:53 +0000)
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>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm.c

index 494c14e80ff94d457ed8a34eca6378c3430b3f6b..fa21903eb25a312622aea166e609f5ead4e9f295 100644 (file)
@@ -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_),                         \