From: Qiuer Zhu <chaozyhaha@gmail.com>
To: peterz@infradead.org, frederic@kernel.org, tglx@linutronix.de
Cc: chaozyhaha@gmail.com, linux-kernel@vger.kernel.org
Subject: [PATCH] time: Add macros to prevent duplicate inclusion of headers
Date: Sun, 9 Mar 2025 23:05:24 +0800 [thread overview]
Message-ID: <20250309150524.760-1-chaozyhaha@gmail.com> (raw)
Add macros to prevent duplicate inclusion of tick-internal.h
and posix-timers.h.
Signed-off-by: Qiuer Zhu <chaozyhaha@gmail.com>
---
kernel/time/posix-timers.h | 5 +++++
kernel/time/tick-internal.h | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/kernel/time/posix-timers.h b/kernel/time/posix-timers.h
index 61906f0688c1..5166b832143f 100644
--- a/kernel/time/posix-timers.h
+++ b/kernel/time/posix-timers.h
@@ -1,4 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _POSIX_TIMERS_H
+#define _POSIX_TIMERS_H
+
#define TIMER_RETRY 1
enum posix_timer_state {
@@ -50,3 +53,5 @@ int common_timer_set(struct k_itimer *timr, int flags,
struct itimerspec64 *old_setting);
void posix_timer_set_common(struct k_itimer *timer, struct itimerspec64 *new_setting);
int common_timer_del(struct k_itimer *timer);
+
+#endif
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h
index faac36de35b9..bcccc0975f70 100644
--- a/kernel/time/tick-internal.h
+++ b/kernel/time/tick-internal.h
@@ -1,4 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _TICK_INTERNAL_H
+#define _TICK_INTERNAL_H
+
/*
* tick internal variable and functions used by low/high res code
*/
@@ -213,3 +216,5 @@ void hrtimers_resume_local(void);
#endif
extern ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt);
+
+#endif
--
2.32.0.windows.2
next reply other threads:[~2025-03-09 15:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-09 15:05 Qiuer Zhu [this message]
2025-03-09 18:33 ` [PATCH] time: Add macros to prevent duplicate inclusion of headers Thomas Gleixner
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=20250309150524.760-1-chaozyhaha@gmail.com \
--to=chaozyhaha@gmail.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox