mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 2/2] test: self: mmu: fix invalid use of __is_defined
Date: Tue, 23 May 2023 11:42:08 +0200	[thread overview]
Message-ID: <20230523094208.3453910-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230523094208.3453910-1-a.fatoum@pengutronix.de>

__is_defined is only usable for undefined macros and defined macros with
a value. __is_defined on a defined macro without a value are will yield
zero, which is unfortunate as ARCH_HAS_REMAP is defined without a value
for the architectures that define it. The header has an arch_can_remap()
helper that's already used to guard remapping code in the memtest
command, so let's make use of it instead. While at it, fix the skipped
test count to correctly reflect the number of tests skipped.

This should fix failure of the test on x86, where remapping is not
supported as we run under EFI and don't touch page tables.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/self/mmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/self/mmu.c b/test/self/mmu.c
index 48515b30aeb8..5e630e708f02 100644
--- a/test/self/mmu.c
+++ b/test/self/mmu.c
@@ -79,8 +79,8 @@ static void test_remap(void)
 	memtest(buffer, SZ_8M, "cached buffer");
 	memtest(mirror, SZ_8M, "cached mirror");
 
-	if (__is_defined(ARCH_HAS_REMAP)) {
-		skipped_tests += 10;
+	if (!arch_can_remap()) {
+		skipped_tests += 18;
 		goto out;
 	}
 
-- 
2.39.2




  reply	other threads:[~2023-05-23  9:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23  9:42 [PATCH master 1/2] test: self: mmu: remap buffer with default attributes on exit Ahmad Fatoum
2023-05-23  9:42 ` Ahmad Fatoum [this message]
2023-05-25  6:50 ` 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=20230523094208.3453910-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --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