diff mbox series

[XEN,11/13] xen/sched: address violations of MISRA C:2012 Directive 4.10

Message ID 8f2179f60335edcf97a04e1c35c7f4bb574c2145.1693228255.git.simone.ballarin@bugseng.com (mailing list archive)
State Superseded
Headers show
Series address violations of MISRA C:2012 Directive 4.10 | expand

Commit Message

Simone Ballarin Aug. 28, 2023, 1:20 p.m. UTC
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").

Mechanical change.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
---
 xen/common/sched/compat.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Stefano Stabellini Aug. 28, 2023, 10:43 p.m. UTC | #1
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").
> 
> Mechanical change.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/common/sched/compat.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/xen/common/sched/compat.c b/xen/common/sched/compat.c
> index a596e3a226..d718e450d4 100644
> --- a/xen/common/sched/compat.c
> +++ b/xen/common/sched/compat.c
> @@ -3,6 +3,10 @@
>   *
>   */
>  
> +#ifndef __COMMON_SCHED_COMPAT_C__
> +#define __COMMON_SCHED_COMPAT_C__
> +
> +
>  #include <compat/sched.h>
>  
>  #define COMPAT
> @@ -44,6 +48,8 @@ int compat_set_timer_op(uint32_t lo, int32_t hi)
>      return do_set_timer_op(((s64)hi << 32) | lo);
>  }
>  
> +#endif /* __COMMON_SCHED_COMPAT_C__ */
> +
>  /*
>   * Local variables:
>   * mode: C
> -- 
> 2.34.1
>
George Dunlap Aug. 30, 2023, 2:54 p.m. UTC | #2
On Mon, Aug 28, 2023 at 2:20 PM Simone Ballarin
<simone.ballarin@bugseng.com> 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").
>
> Mechanical change.
>
> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>

Reviewed-by: George Dunlap <george.dunlap@cloud.com>
diff mbox series

Patch

diff --git a/xen/common/sched/compat.c b/xen/common/sched/compat.c
index a596e3a226..d718e450d4 100644
--- a/xen/common/sched/compat.c
+++ b/xen/common/sched/compat.c
@@ -3,6 +3,10 @@ 
  *
  */
 
+#ifndef __COMMON_SCHED_COMPAT_C__
+#define __COMMON_SCHED_COMPAT_C__
+
+
 #include <compat/sched.h>
 
 #define COMPAT
@@ -44,6 +48,8 @@  int compat_set_timer_op(uint32_t lo, int32_t hi)
     return do_set_timer_op(((s64)hi << 32) | lo);
 }
 
+#endif /* __COMMON_SCHED_COMPAT_C__ */
+
 /*
  * Local variables:
  * mode: C