Skip to contentSkip to conversation

xen/xsm: dummy.h: Fix MISRA C 2012 Directive 4.10 violation

PATCH In review Xenia Ragiadakou 3 participants 3 messages Jul 27, 2022 – Jul 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/xsm: dummy.h: Fix MISRA C 2012 Directive 4.10 violation

Protect header file from being included more than once by adding ifndef guard.

---
 xen/include/xsm/dummy.h | 5 +++++
 1 file changed, 5 insertions(+)
xen/include/xsm/dummy.h +5 -0
index 77f27e7163..8671af1ba4 100644
@@ -15,6 +15,9 @@
  *  value of action.
  */
 
+#ifndef __XEN_XSM_DUMMY_H__
+#define __XEN_XSM_DUMMY_H__
+
 #include <xen/sched.h>
 #include <xsm/xsm.h>
 #include <public/hvm/params.h>
@@ -843,3 +846,5 @@ static XSM_INLINE int cf_check xsm_domain_resource_map(
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
+
+#endif /* __XEN_XSM_DUMMY_H__ */
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#2 lore raw
In reply to Xenia Ragiadakou
Quoted 22 lines · Xenia Ragiadakou

Protect header file from being included more than once by adding ifndef guard.

---
  xen/include/xsm/dummy.h | 5 +++++
  1 file changed, 5 insertions(+)
xen/include/xsm/dummy.h +3 -0
index 77f27e7163..8671af1ba4 100644
@@ -15,6 +15,9 @@
   *  value of action.
   */
 
+#ifndef __XEN_XSM_DUMMY_H__
+#define __XEN_XSM_DUMMY_H__
+
  #include <xen/sched.h>
  #include <xsm/xsm.h>
  #include <public/hvm/params.h>

xen/include/xsm/dummy.h static XSM_INLINE int cf_check xsm_domain_resource_map( · line 850

Quoted 5 lines
xen/include/xsm/dummy.h +2 -0
@@ -843,3 +846,5 @@ static XSM_INLINE int cf_check xsm_domain_resource_map(
      XSM_ASSERT_ACTION(XSM_DM_PRIV);
      return xsm_default_action(action, current->domain, d);
  }
+
+#endif /* __XEN_XSM_DUMMY_H__ */