]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
test: py: Move ram base address detection out of loop
authorMichal Simek <michal.simek@xilinx.com>
Tue, 23 Jan 2018 12:35:09 +0000 (13:35 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 31 Jan 2018 12:15:51 +0000 (13:15 +0100)
There is no reason to read base address in a loop. Do it just once.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
test/py/tests/test_qspi.py

index b5138503d977c7b53fb214ec452752faed3b9fb6..e495837f87ed80a14b08188fdd96c2d43b4cce26 100644 (file)
@@ -147,6 +147,7 @@ def test_qspi_erase_block(u_boot_console):
 def qspi_write_twice(u_boot_console):
 
     qspi_erase_block(u_boot_console)
+    addr = u_boot_utils.find_ram_base(u_boot_console)
     expected_write = "Written: OK"
     expected_read = "Read: OK"
 
@@ -154,7 +155,6 @@ def qspi_write_twice(u_boot_console):
     # TODO maybe add alignment and different start for pages
     for size in random.randint(4, page_size), random.randint(page_size, total_size), total_size:
         offset = random.randint(4, page_size)
-        addr = u_boot_utils.find_ram_base(u_boot_console)
         size = size - old_size
         output = u_boot_console.run_command('crc32 %x %x' % (addr + total_size, size))
         m = re.search('==> (.+?)$', output)