]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
mm: don't use _{g,m}fn for defining INVALID_{G,M}FN
authorJulien Grall <julien.grall@arm.com>
Tue, 20 Jun 2017 12:48:10 +0000 (14:48 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Jun 2017 12:48:10 +0000 (14:48 +0200)
INVALID_{G,M}FN are defined using static inline helpers _{g,m}fn.
This means, they cannot be used to initialize a build time static variable:

In file included from mm.c:24:0:
xen/xen/include/xen/mm.h:59:26: error: initializer element is not constant
 #define INVALID_MFN      _mfn(~0UL)

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Tim Deegan <tim@xen.org>
[jb: add parentheses and const]
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/include/xen/mm.h

index db057f605de288439bb97b0a8fb1c2ac89889aaf..3d3f31be93deb6c2f79d3bcdc18b3d221b039211 100644 (file)
@@ -56,7 +56,7 @@
 
 TYPE_SAFE(unsigned long, mfn);
 #define PRI_mfn          "05lx"
-#define INVALID_MFN      _mfn(~0UL)
+#define INVALID_MFN      ((const mfn_t){ ~0UL })
 
 #ifndef mfn_t
 #define mfn_t /* Grep fodder: mfn_t, _mfn() and mfn_x() are defined above */
@@ -89,7 +89,7 @@ static inline bool_t mfn_eq(mfn_t x, mfn_t y)
 
 TYPE_SAFE(unsigned long, gfn);
 #define PRI_gfn          "05lx"
-#define INVALID_GFN      _gfn(~0UL)
+#define INVALID_GFN      ((const gfn_t){ ~0UL })
 
 #ifndef gfn_t
 #define gfn_t /* Grep fodder: gfn_t, _gfn() and gfn_x() are defined above */