]> xenbits.xensource.com Git - xen.git/commitdiff
xen/misra: xen-analysis.py: Fix latent bug
authorLuca Fancellu <luca.fancellu@arm.com>
Tue, 30 May 2023 09:57:02 +0000 (11:57 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 30 May 2023 09:57:02 +0000 (11:57 +0200)
Currenly there is a latent bug that is not triggered because
the function cppcheck_merge_txt_fragments is called with the
parameter strip_paths having a list of only one element.

The bug is that the split function should not be in the
loop for strip_paths, but one level before, fix it.

Fixes: 02b26c02c7c4 ("xen/scripts: add cppcheck tool to the xen-analysis.py script")
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Tested-by: Stefano Stabellini <sstabellini@kernel.org>
xen/scripts/xen_analysis/cppcheck_report_utils.py

index c5f466aff14193ef4e62473cdb25df854d29fac6..fdc299c7e0290959f9557aa58947b2da4d82459e 100644 (file)
@@ -104,8 +104,8 @@ def cppcheck_merge_txt_fragments(fragments_list, out_txt_file, strip_paths):
                 for path in strip_paths:
                     text_report_content[i] = text_report_content[i].replace(
                                                                 path + "/", "")
-                    # Split by : separator
-                    text_report_content[i] = text_report_content[i].split(":")
+                # Split by : separator
+                text_report_content[i] = text_report_content[i].split(":")
 
             # sort alphabetically for second field (misra rule) and as second
             # criteria for the first field (file name)