From: Stefano Stabellini <stefano.stabellini@amd.com>
To: <xen-devel@lists.xenproject.org>
Cc: <andrew.cooper3@citrix.com>, <michal.orzel@amd.com>,
<jbeulich@suse.com>, <julien@xen.org>, <roger.pau@citrix.com>,
<sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
Federico Serafini <federico.serafini@bugseng.com>,
Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH v2 4/6] xen: refactor include guards
Date: Fri, 16 May 2025 17:10:05 -0700 [thread overview]
Message-ID: <20250517001005.860657-1-stefano.stabellini@amd.com> (raw)
In-Reply-To: <d1bcab8a-873c-42ed-b7e8-071c009bcc3a@citrix.com>
From: Federico Serafini <federico.serafini@bugseng.com>
Refactor inclusion guards:
1) use a syntax that is more likely to be recognized by static
analyzers;
2) follow the CODING_STYLE.
No functional change.
Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
Changes in v2:
- use normal #ifndef
---
xen/include/xen/err.h | 10 +++++++---
xen/include/xen/softirq.h | 10 +++++++---
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/xen/include/xen/err.h b/xen/include/xen/err.h
index cbdd1bf7f8..a5971e290c 100644
--- a/xen/include/xen/err.h
+++ b/xen/include/xen/err.h
@@ -1,5 +1,7 @@
-#if !defined(__XEN_ERR_H__) && !defined(__ASSEMBLY__)
-#define __XEN_ERR_H__
+#ifndef XEN_ERR_H
+#define XEN_ERR_H
+
+#ifndef __ASSEMBLY__
#include <xen/compiler.h>
#include <xen/errno.h>
@@ -41,4 +43,6 @@ static inline int __must_check PTR_RET(const void *ptr)
return IS_ERR(ptr) ? PTR_ERR(ptr) : 0;
}
-#endif /* __XEN_ERR_H__ */
+#endif /* __ASSEMBLY__ */
+
+#endif /* XEN_ERR_H */
diff --git a/xen/include/xen/softirq.h b/xen/include/xen/softirq.h
index 33d6f2ecd2..e9f79ec0ce 100644
--- a/xen/include/xen/softirq.h
+++ b/xen/include/xen/softirq.h
@@ -1,5 +1,7 @@
-#if !defined(__XEN_SOFTIRQ_H__) && !defined(__ASSEMBLY__)
-#define __XEN_SOFTIRQ_H__
+#ifndef XEN_SOFTIRQ_H
+#define XEN_SOFTIRQ_H
+
+#ifndef __ASSEMBLY__
/* Low-latency softirqs come first in the following list. */
enum {
@@ -40,4 +42,6 @@ void cpu_raise_softirq_batch_finish(void);
*/
void process_pending_softirqs(void);
-#endif /* __XEN_SOFTIRQ_H__ */
+#endif /* __ASSEMBLY__ */
+
+#endif /* XEN_SOFTIRQ_H */
--
2.25.1
next prev parent reply other threads:[~2025-05-17 0:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 23:21 [PATCH 0/6] MISRA D4.10: fix header guards Stefano Stabellini
2025-05-16 23:21 ` [PATCH 1/6] xen/arm: add inclusion guards Stefano Stabellini
2025-05-16 23:23 ` Andrew Cooper
2025-05-19 22:25 ` Julien Grall
2025-05-16 23:21 ` [PATCH 2/6] xen/x86: " Stefano Stabellini
2025-05-16 23:24 ` Andrew Cooper
2025-05-16 23:21 ` [PATCH 3/6] xen: " Stefano Stabellini
2025-05-16 23:27 ` Andrew Cooper
2025-05-16 23:21 ` [PATCH 4/6] xen: refactor include guards Stefano Stabellini
2025-05-16 23:29 ` Andrew Cooper
2025-05-17 0:10 ` Stefano Stabellini [this message]
2025-05-17 0:13 ` [PATCH v2 " Andrew Cooper
2025-05-16 23:21 ` [PATCH 5/6] x86/asm: refactor inclusion guards Stefano Stabellini
2025-05-17 0:10 ` Andrew Cooper
2025-05-16 23:21 ` [PATCH 6/6] automation/eclair: update configuration of D4.10 Stefano Stabellini
2025-05-16 23:57 ` Andrew Cooper
2025-05-19 14:13 ` Federico Serafini
2025-05-19 21:36 ` Stefano Stabellini
2025-05-23 15:49 ` Federico Serafini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250517001005.860657-1-stefano.stabellini@amd.com \
--to=stefano.stabellini@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=bertrand.marquis@arm.com \
--cc=federico.serafini@bugseng.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.