mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 2/2] memtest: Make use of resource_size()
Date: Mon, 17 Sep 2018 22:03:43 -0700	[thread overview]
Message-ID: <20180918050343.19637-2-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20180918050343.19637-1-andrew.smirnov@gmail.com>

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 commands/memtest.c | 3 +--
 common/memtest.c   | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/commands/memtest.c b/commands/memtest.c
index 403ab91f6..dc8f7db27 100644
--- a/commands/memtest.c
+++ b/commands/memtest.c
@@ -36,8 +36,7 @@ static int do_test_one_area(struct mem_test_resource *r, int bus_only,
 	printf("Testing memory space: %pa -> %pa:\n",
 	       &r->r->start,  &r->r->end);
 
-	remap_range((void *)r->r->start, r->r->end -
-			r->r->start + 1, cache_flag);
+	remap_range((void *)r->r->start, resource_size(r->r), cache_flag);
 
 	ret = mem_test_bus_integrity(r->r->start, r->r->end);
 	if (ret < 0)
diff --git a/common/memtest.c b/common/memtest.c
index 5c96d46e9..44ddedd3d 100644
--- a/common/memtest.c
+++ b/common/memtest.c
@@ -131,8 +131,8 @@ void mem_test_release_regions(struct list_head *list)
 		/*
 		 * Ensure to leave with a cached on non used sdram regions.
 		 */
-		remap_range((void *)r->r->start, r->r->end -
-				r->r->start + 1, MAP_DEFAULT);
+		remap_range((void *)r->r->start, resource_size(r->r),
+			    MAP_DEFAULT);
 
 		release_sdram_region(r->r);
 		free(r);
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2018-09-18  5:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18  5:03 [PATCH 1/2] memtest: Adjust code for 64-bit architectures Andrey Smirnov
2018-09-18  5:03 ` Andrey Smirnov [this message]
2018-09-19  7:32 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180918050343.19637-2-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox