* [PATCH] compat: add header guard to xlat.h
@ 2025-06-03 6:44 Jan Beulich
2025-06-03 7:13 ` Andrew Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2025-06-03 6:44 UTC (permalink / raw)
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Anthony PERARD,
Michal Orzel, Roger Pau Monné
This is to conform with Misra C:2012 Directive 4.10.
Reported-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -105,9 +105,14 @@ xlat-y := $(shell sed -ne 's,@arch@,$(co
xlat-y := $(filter $(patsubst compat/%,%,$(headers-y)),$(xlat-y))
quiet_cmd_xlat_h = GEN $@
-cmd_xlat_h = \
- cat $(filter %.h,$^) >$@.new; \
- mv -f $@.new $@
+define cmd_xlat_h
+ echo "#ifndef COMPAT_XLAT_H" >$@.new; \
+ echo "#define COMPAT_XLAT_H" >>$@.new; \
+ cat $(filter %.h,$^) >>$@.new; \
+ echo "" >>$@.new; \
+ echo "#endif /* COMPAT_XLAT_H */" >>$@.new; \
+ mv -f $@.new $@
+endef
$(obj)/compat/xlat.h: $(addprefix $(obj)/compat/.xlat/,$(xlat-y)) FORCE
$(call if_changed,xlat_h)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-03 7:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-03 6:44 [PATCH] compat: add header guard to xlat.h Jan Beulich
2025-06-03 7:13 ` Andrew Cooper
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.