compat: add header guard to xlat.h
PATCH 1/1 compat: add header guard to xlat.h
This is to conform with Misra C:2012 Directive 4.10.
Reported-by Stefano Stabellini <[email protected]>
Signed-off-by Jan Beulich <[email protected]>
xen/include/Makefile +8 -3
@@ -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)
Quoted 4 lines · Jan Beulich
This is to conform with Misra C:2012 Directive 4.10.
Reported-by Stefano Stabellini <[email protected]>Signed-off-by Jan Beulich <[email protected]>
Reviewed-by Andrew Cooper <[email protected]>