Skip to content
Permalink
Browse files

tools: hardware-check: Fix duplicate variable name usage

We already use "n" for the outer loop that iterate over all IOMMUs. Make
the register offset calculation more readable at this chance.

Reported-by: Burak Atalay <Burak.Atalay@rohde-schwarz.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information...
jan-kiszka committed Apr 1, 2019
1 parent 2b039fa commit c4963cc113063ef3222a07ac64520767a54f05ab
Showing with 2 additions and 2 deletions.
  1. +2 −2 tools/jailhouse-hardware-check
@@ -300,8 +300,8 @@ elif cpu_vendor == 'AuthenticAMD':
check_feature(' SMI filter', ((efr >> 16) & 0x3) == 1):
smi_filter_ok = True
num_filter_regs = 1 << ((efr >> 18) & 7)
for n in range(num_filter_regs):
smi_freg = mmio.read64(0x60 + (n << 3))
for reg in range(num_filter_regs):
smi_freg = mmio.read64(0x60 + reg * 8)
# must not be locked AND set to match against specific device
if smi_freg & (1 << 17) and smi_freg & (1 << 16):
smi_filter_ok = False

0 comments on commit c4963cc

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