This is to conform with Misra C:2012 Directive 4.10. Reported-by: Stefano Stabellini <[email protected]> Signed-off-by: Jan Beulich <[email protected]>
--- 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,$^) >[email protected]; \ - mv -f [email protected] $@ +define cmd_xlat_h + echo "#ifndef COMPAT_XLAT_H" >[email protected]; \ + echo "#define COMPAT_XLAT_H" >>[email protected]; \ + cat $(filter %.h,$^) >>[email protected]; \ + echo "" >>[email protected]; \ + echo "#endif /* COMPAT_XLAT_H */" >>[email protected]; \ + mv -f [email protected] $@ +endef $(obj)/compat/xlat.h: $(addprefix $(obj)/compat/.xlat/,$(xlat-y)) FORCE $(call if_changed,xlat_h)
