* [PATCH] time: Add macros to prevent duplicate inclusion of headers
@ 2025-03-09 15:05 Qiuer Zhu
2025-03-09 18:33 ` Thomas Gleixner
0 siblings, 1 reply; 2+ messages in thread
From: Qiuer Zhu @ 2025-03-09 15:05 UTC (permalink / raw)
To: peterz, frederic, tglx; +Cc: chaozyhaha, linux-kernel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] time: Add macros to prevent duplicate inclusion of headers
2025-03-09 15:05 [PATCH] time: Add macros to prevent duplicate inclusion of headers Qiuer Zhu
@ 2025-03-09 18:33 ` Thomas Gleixner
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2025-03-09 18:33 UTC (permalink / raw)
To: Qiuer Zhu, peterz, frederic; +Cc: chaozyhaha, linux-kernel
On Sun, Mar 09 2025 at 23:05, Qiuer Zhu wrote:
> Add macros to prevent duplicate inclusion of tick-internal.h
> and posix-timers.h.
That's a problem for public headers, but not for directory local
headers. They don't suffer the problem of accidental recursion.
Thanks,
tglx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-09 18:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-09 15:05 [PATCH] time: Add macros to prevent duplicate inclusion of headers Qiuer Zhu
2025-03-09 18:33 ` Thomas Gleixner
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.