[PATCH] tools: config-create: fix iterator index manipulation in PCIBARs

2 views
Skip to first unread message

Henning Schild

unread,
Aug 16, 2016, 9:32:40 AM8/16/16
to jailho...@googlegroups.com, Henning Schild
The n += 1, to skip a line in the 64bit case, never had an effect.
Change the iterator so it can be manipulated like that.

Fixes: d1f763162ce6 ("core, tools: Add BAR masks to
jailhouse_pci_device")

Signed-off-by: Henning Schild <henning...@siemens.com>
---
tools/jailhouse-config-create | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/jailhouse-config-create b/tools/jailhouse-config-create
index f0d65ed..0ac88ee 100755
--- a/tools/jailhouse-config-create
+++ b/tools/jailhouse-config-create
@@ -168,8 +168,10 @@ class PCIBARs:
def __init__(self, dir):
self.mask = []
f = input_open(os.path.join(dir, 'resource'), 'r')
- for n in range(6):
+ n = 0
+ while (n < 6):
(start, end, flags) = f.readline().split()
+ n += 1
flags = int(flags, 16)
if flags & PCIBARs.IORESOURCE_IO:
mask = ~(int(end, 16) - int(start, 16))
--
2.7.3

Jan Kiszka

unread,
Aug 19, 2016, 5:47:30 AM8/19/16
to Henning Schild, jailho...@googlegroups.com
Thanks, queued.

Jan

--
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux
Reply all
Reply to author
Forward
0 new messages