Skip to content
Permalink
Browse files

pyjailhouse: Remove superfluous definition and fix linter warnings

'vector_size' was set, but not used.

No functional change.

Fixes: f6fef92 ("pyjailhouse: sysfs_parser: Add more precise length of some extended caps")
Signed-off-by: Andrej Utz <andrej.utz@st.oth-regensburg.de>
[Jan: drop style conversion of tuple assignment]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information...
xentec authored and jan-kiszka committed Sep 30, 2019
1 parent 4c72146 commit edfe64fd80ee568d61c759d77396fd134715ede4
Showing with 4 additions and 3 deletions.
  1. +4 −3 pyjailhouse/sysfs_parser.py
@@ -490,7 +490,7 @@ def format_bdf(bdf):

regions.append(
MemRegion(mem_addr, mem_addr + mem_len - 1, 'ACPI IVRS',
comment))
comment))

elif type == 0x40:
raise RuntimeError(
@@ -665,21 +665,22 @@ def parse_pcicaps(dir):
len = 4 + (vsec_len >> 20)
elif id == PCI_EXT_CAP_ID.ACS:
len = 8
vector_size = 0

(acs_cap, acs_ctrl) = struct.unpack('<HH', f.read(4))
if acs_cap & (1 << 5) and acs_ctrl & (1 << 5):
vector_bits = acs_cap >> 8
if vector_bits == 0:
vector_bits = 256

vector_bytes = int((vector_bits + 31) / (8 * 4))
len += vector_bytes
elif id in [PCI_EXT_CAP_ID.VC, PCI_EXT_CAP_ID.VC9]:
# parsing is too complex, but we have at least 4 DWORDS
len = 4 * 4
elif id == PCI_EXT_CAP_ID.MFVC:
len = 4
elif id in [PCI_EXT_CAP_ID.LTR, PCI_EXT_CAP_ID.ARI, PCI_EXT_CAP_ID.PASID]:
elif id in [PCI_EXT_CAP_ID.LTR, PCI_EXT_CAP_ID.ARI,
PCI_EXT_CAP_ID.PASID]:
len = 8
elif id in [PCI_EXT_CAP_ID.DSN, PCI_EXT_CAP_ID.PTM]:
len = 12

0 comments on commit edfe64f

Please sign in to comment.
You can’t perform that action at this time.