[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 10/17] x86/asm: address violations of MISRA C:2012 Directive 4.10



On 2024-07-03 14:49, Jan Beulich wrote:
On 01.07.2024 15:36, Alessandro Zucchelli wrote:
--- a/docs/misra/safe.json
+++ b/docs/misra/safe.json
@@ -90,6 +90,14 @@
             "name": "Dir 4.10: direct inclusion guard before",
"text": "Headers with just the direct inclusion guard before the inclusion guard are safe."
         },
+        {
+            "id": "SAF-11-safe",
+            "analyser": {
+                "eclair": "MC3R1.D4.10"
+            },
+            "name": "Dir 4.10: file intended for multiple inclusion",
+ "text": "Files intended for multiple inclusion are not supposed to comply with D4.10."
+        },
         {
             "id": "SAF-11-safe",

This can't be right; the sentinel must have its number changed.

Yes, this must have been overlooked during the rebasing of the previous patch version's commits.


--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -104,10 +104,17 @@ $(obj)/compat/.xlat/%.lst: $(srcdir)/xlat.lst FORCE xlat-y := $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -re 's,^[?!][[:blank:]]+[^[:blank:]]+[[:blank:]]+,,p' $(srcdir)/xlat.lst | uniq)
 xlat-y := $(filter $(patsubst compat/%,%,$(headers-y)),$(xlat-y))

+ARCHDIR = $(shell echo $(SRCARCH) | tr a-z A-Z)

Why is this being added here? It's not used ...

It was mistakenly left here from the previous version of the patch series.


 quiet_cmd_xlat_h = GEN     $@
-cmd_xlat_h = \
-       cat $(filter %.h,$^) >$@.new; \
+define cmd_xlat_h
+       guard=$$(echo ASM_${SRCARCH}_COMPAT_XLAT_H | tr a-z A-Z); \
+       echo "#ifndef $$guard" > $@.new; \
+       echo "#define $$guard" >> $@.new; \
+       cat $(filter %.h,$^) >> $@.new; \
+       echo "#endif /* $$guard */" >> $@.new; \
        mv -f $@.new $@
+endef

$(obj)/compat/xlat.h: $(addprefix $(obj)/compat/.xlat/,$(xlat-y)) FORCE
        $(call if_changed,xlat_h)

... anywhere. Did you mean to use it in place of ${SRCARCH}?

No, SRCARCH is correct, as ARCHDIR was supposed to be removed.

--
Alessandro Zucchelli, B.Sc.

Software Engineer, BUGSENG (https://bugseng.com)



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.