]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
Fix LGTM static analysis issues
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 15 Apr 2021 17:05:05 +0000 (18:05 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 15 Apr 2021 17:09:57 +0000 (18:09 +0100)
 * xtf-runner: Class TestInstance implements __hash__ but does not define __eq__.
 * mkinfo.py: Import of 'os' is not used.

LGTM also complains about gdt/idt/tss being global symbols with too-short
names.  As they're the most appropriate architectural names, insert
suppression comments.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/desc.c
arch/x86/hvm/traps.c
build/mkinfo.py
xtf-runner

index e452e092c6ae6ff75d9fa94b5617899ea2bc5828..35e2e70c5c155054b6308629ab05a3be8dfc969f 100644 (file)
@@ -10,7 +10,7 @@
 #define gdt_section __page_aligned_bss
 #endif
 
-user_desc gdt[NR_GDT_ENTRIES] gdt_section =
+user_desc gdt[NR_GDT_ENTRIES] gdt_section = /* lgtm [cpp/short-global-name] */
 {
 #ifdef CONFIG_HVM
     [GDTE_CS64_DPL0] = INIT_GDTE_SYM(0, 0xfffff, COMMON, CODE, DPL0, R, L),
@@ -34,7 +34,7 @@ desc_ptr gdt_ptr =
     .base = _u(&gdt),
 };
 
-env_gate idt[256];
+env_gate idt[256]; /* lgtm [cpp/short-global-name] */
 
 desc_ptr idt_ptr =
 {
index ae3d3ef35b62aa7e7b5739e8dfae67df1632bb36..6eee8124023126f6d0a5bd0013b5a8c2b5099dab 100644 (file)
@@ -32,7 +32,7 @@ void entry_XM(void);
 void entry_VE(void);
 void entry_ret_to_kernel(void);
 
-env_tss tss __aligned(16) =
+env_tss tss __aligned(16) = /* lgtm [cpp/short-global-name] */
 {
 #if defined(__i386__)
 
index 94891a9bd96f5576f065b05e4eb75d3517a93773..50819e2c53cafe44aaaa8cbeecdb033ada2118fe 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import sys, os, json
+import sys, json
 
 # Usage: mkcfg.py $OUT $NAME $CATEGORY $ENVS $VARIATIONS
 _, out, name, cat, envs, variations = sys.argv
index b3df4a19067c7fb58603dd080e37eeb5bce17f4c..6352a5b3e1268baf1f9a5986ff7ace4a5c397898 100755 (executable)
@@ -86,6 +86,12 @@ class TestInstance(object):
     def __hash__(self):
         return hash(repr(self))
 
+    def __eq__(self, other):
+        return repr(self) == repr(other)
+
+    def __ne__(self, other):
+        return repr(self) != repr(other)
+
     def __cmp__(self, other):
         return cmp(repr(self), repr(other))