time: Add macros to prevent duplicate inclusion of headers
Subsystems (2)
PATCH 1/1 time: Add macros to prevent duplicate inclusion of headers
Add macros to prevent duplicate inclusion of tick-internal.h and posix-timers.h.
Signed-off-by Qiuer Zhu <[email protected]>
--- kernel/time/posix-timers.h | 5 +++++ kernel/time/tick-internal.h | 5 +++++ 2 files changed, 10 insertions(+)
kernel/time/posix-timers.h +5 -0
@@ -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
kernel/time/tick-internal.h +5 -0
@@ -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
Signature · 1 line
2.32.0.windows.2
Quoted 2 lines · Qiuer Zhu
Add macros to prevent duplicate inclusion of
tick-internal.handposix-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