This is to conform with Misra C:2012 Directive 4.10. Reported-by: Stefano Stabellini <sstabell...@kernel.org> Signed-off-by: Jan Beulich <jbeul...@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)