Message ID | b994059118b867960b619d40d74c8f579c0a4d87.1693228255.git.simone.ballarin@bugseng.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | address violations of MISRA C:2012 Directive 4.10 | expand |
On Mon, 28 Aug 2023, Simone Ballarin wrote: > Add inclusion guards to address violations of > MISRA C:2012 Directive 4.10 ("Precautions shall be taken in order > to prevent the contents of a header file being included more than > once"). > > C files, if included somewhere, need to comply with the guideline. > > Mechanical change. > > Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> > --- > xen/arch/x86/mm/guest_walk.c | 5 +++++ > xen/arch/x86/mm/hap/guest_walk.c | 4 ++++ > 2 files changed, 9 insertions(+) > > diff --git a/xen/arch/x86/mm/guest_walk.c b/xen/arch/x86/mm/guest_walk.c > index fe7393334f..66c127156d 100644 > --- a/xen/arch/x86/mm/guest_walk.c > +++ b/xen/arch/x86/mm/guest_walk.c > @@ -9,6 +9,9 @@ > * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al. > */ > > +#ifndef __X86_MM_GUEST_WALK_C__ > +#define __X86_MM_GUEST_WALK_C__ > + > #include <xen/types.h> > #include <xen/mm.h> > #include <xen/paging.h> > @@ -576,6 +579,8 @@ void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn, > } > #endif > > +#endif /* __X86_MM_GUEST_WALK_C__ */ > + > /* > * Local variables: > * mode: C > diff --git a/xen/arch/x86/mm/hap/guest_walk.c b/xen/arch/x86/mm/hap/guest_walk.c > index d1b7c5762c..d4ffa8141f 100644 > --- a/xen/arch/x86/mm/hap/guest_walk.c > +++ b/xen/arch/x86/mm/hap/guest_walk.c > @@ -7,6 +7,9 @@ > * Copyright (c) 2007, XenSource Inc. > */ > > +#ifndef __X86_MM_HAP_GUEST_WALK_C__ > +#define __X86_MM_HAP_GUEST_WALK_C__ > + > #include <xen/domain_page.h> > #include <xen/paging.h> > #include <xen/sched.h> > @@ -124,6 +127,7 @@ unsigned long cf_check hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)( > return gfn_x(INVALID_GFN); > } > > +#endif /* __X86_MM_HAP_GUEST_WALK_C__ */ > > /* > * Local variables: > -- > 2.34.1 >
diff --git a/xen/arch/x86/mm/guest_walk.c b/xen/arch/x86/mm/guest_walk.c index fe7393334f..66c127156d 100644 --- a/xen/arch/x86/mm/guest_walk.c +++ b/xen/arch/x86/mm/guest_walk.c @@ -9,6 +9,9 @@ * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al. */ +#ifndef __X86_MM_GUEST_WALK_C__ +#define __X86_MM_GUEST_WALK_C__ + #include <xen/types.h> #include <xen/mm.h> #include <xen/paging.h> @@ -576,6 +579,8 @@ void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn, } #endif +#endif /* __X86_MM_GUEST_WALK_C__ */ + /* * Local variables: * mode: C diff --git a/xen/arch/x86/mm/hap/guest_walk.c b/xen/arch/x86/mm/hap/guest_walk.c index d1b7c5762c..d4ffa8141f 100644 --- a/xen/arch/x86/mm/hap/guest_walk.c +++ b/xen/arch/x86/mm/hap/guest_walk.c @@ -7,6 +7,9 @@ * Copyright (c) 2007, XenSource Inc. */ +#ifndef __X86_MM_HAP_GUEST_WALK_C__ +#define __X86_MM_HAP_GUEST_WALK_C__ + #include <xen/domain_page.h> #include <xen/paging.h> #include <xen/sched.h> @@ -124,6 +127,7 @@ unsigned long cf_check hap_p2m_ga_to_gfn(GUEST_PAGING_LEVELS)( return gfn_x(INVALID_GFN); } +#endif /* __X86_MM_HAP_GUEST_WALK_C__ */ /* * Local variables:
Add inclusion guards to address violations of MISRA C:2012 Directive 4.10 ("Precautions shall be taken in order to prevent the contents of a header file being included more than once"). C files, if included somewhere, need to comply with the guideline. Mechanical change. Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com> --- xen/arch/x86/mm/guest_walk.c | 5 +++++ xen/arch/x86/mm/hap/guest_walk.c | 4 ++++ 2 files changed, 9 insertions(+)