xen: avoid grep fodder define and undef

Place an "#if 0" before grep fodder #define-s and remove
the #undef-s.

This addresses violations of MISRA C:2012 Rules 20.5 ("#undef should
not be used") and 5.5 ("Identifiers shall be distinct from macro
names").

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Federico Serafini authored and Jan Beulich committed 2024-03-14 13:55:27 +01:00
1 parent 70e549fd44
commit 68e008db0c
2 files changed
+4 -16

No files matched your search

+1 -4
View File
@@ -33,13 +33,10 @@ TYPE_SAFE(uint64_t, dfn);
#define PRI_dfn PRIx64
#define INVALID_DFN _dfn(~0ULL)
#ifndef dfn_t
#if 0
#define dfn_t /* Grep fodder: dfn_t, _dfn() and dfn_x() are defined above */
#define _dfn
#define dfn_x
#undef dfn_t
#undef _dfn
#undef dfn_x
#endif
static inline dfn_t __must_check dfn_add(dfn_t dfn, unsigned long i)
+3 -12
View File
@@ -14,13 +14,10 @@ TYPE_SAFE(unsigned long, mfn);
*/
#define INVALID_MFN_INITIALIZER { INVALID_MFN_RAW }
#ifndef mfn_t
#if 0
#define mfn_t /* Grep fodder: mfn_t, _mfn() and mfn_x() are defined above */
#define _mfn
#define mfn_x
#undef mfn_t
#undef _mfn
#undef mfn_x
#endif
static inline mfn_t __must_check mfn_add(mfn_t mfn, unsigned long i)
@@ -53,13 +50,10 @@ TYPE_SAFE(unsigned long, gfn);
*/
#define INVALID_GFN_INITIALIZER { INVALID_GFN_RAW }
#ifndef gfn_t
#if 0
#define gfn_t /* Grep fodder: gfn_t, _gfn() and gfn_x() are defined above */
#define _gfn
#define gfn_x
#undef gfn_t
#undef _gfn
#undef gfn_x
#endif
static inline gfn_t __must_check gfn_add(gfn_t gfn, unsigned long i)
@@ -85,13 +79,10 @@ static inline bool gfn_eq(gfn_t x, gfn_t y)
TYPE_SAFE(unsigned long, pfn);
#define PRI_pfn "05lx"
#ifndef pfn_t
#if 0
#define pfn_t /* Grep fodder: pfn_t, _pfn() and pfn_x() are defined above */
#define _pfn
#define pfn_x
#undef pfn_t
#undef _pfn
#undef pfn_x
#endif
#endif /* __XEN_FRAME_NUM_H__ */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.