[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 1/3] x86/p2m.h: Add include guards
On 09.05.2022 14:24, Andrew Cooper wrote: > Spotted by Eclair MISRA scanner. I'm sorry, but what exactly was it that the scanner spotted? It was actually deliberate to introduce this file without guards. I'm of the general opinion that (private) headers not to be included by other headers (but only by .c files) are not in need of guards. If it is project-wide consensus that _all_ header files should have guards, then I'll try to keep this in mind (in "x86emul: a few small steps towards disintegration" for example I introduce another such instance), but then it should also be put down in ./CODING_STYLE. Jan > Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> > --- > CC: Jan Beulich <JBeulich@xxxxxxxx> > CC: Roger Pau Monné <roger.pau@xxxxxxxxxx> > CC: Wei Liu <wl@xxxxxxx> > CC: Stefano Stabellini <sstabellini@xxxxxxxxxx> > CC: Julien Grall <julien@xxxxxxx> > CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx> > CC: Bertrand Marquis <bertrand.marquis@xxxxxxx> > --- > xen/arch/x86/mm/p2m.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/xen/arch/x86/mm/p2m.h b/xen/arch/x86/mm/p2m.h > index cc0f6766e4df..dc706b8e4799 100644 > --- a/xen/arch/x86/mm/p2m.h > +++ b/xen/arch/x86/mm/p2m.h > @@ -15,6 +15,9 @@ > * along with this program; If not, see <http://www.gnu.org/licenses/>. > */ > > +#ifndef __ARCH_MM_P2M_H__ > +#define __ARCH_MM_P2M_H__ > + > struct p2m_domain *p2m_init_one(struct domain *d); > void p2m_free_one(struct p2m_domain *p2m); > > @@ -39,6 +42,8 @@ int ept_p2m_init(struct p2m_domain *p2m); > void ept_p2m_uninit(struct p2m_domain *p2m); > void p2m_init_altp2m_ept(struct domain *d, unsigned int i); > > +#endif /* __ARCH_MM_P2M_H__ */ > + > /* > * Local variables: > * mode: C
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |