linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: woodrow.shen@sifive.com
To: linux-riscv@lists.infradead.org
Subject: [PATCH] RISC-V: selftests: cbo: Use exported __cpu_to_le32() with uapi header
Date: Thu, 21 Mar 2024 19:52:50 +0800	[thread overview]
Message-ID: <20240321115250.801731-1-woodrow.shen@sifive.com> (raw)

From: Hsieh-Tseng Shen <woodrow.shen@sifive.com>

cpu_to_le32 is not defined in uapi headers, and it could cause an error
of impossible constraint in 'asm' during compilation. However,
the reason is due to undefined reference to cpu_to_le32.
__cpu_to_le32() defined from byteorder.h should be used instead.

Signed-off-by: Hsieh-Tseng Shen <woodrow.shen@sifive.com>
---
 tools/testing/selftests/riscv/hwprobe/cbo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/riscv/hwprobe/cbo.c b/tools/testing/selftests/riscv/hwprobe/cbo.c
index c537d52fafc5..b2dd18b3e360 100644
--- a/tools/testing/selftests/riscv/hwprobe/cbo.c
+++ b/tools/testing/selftests/riscv/hwprobe/cbo.c
@@ -15,11 +15,12 @@
 #include <linux/compiler.h>
 #include <linux/kernel.h>
 #include <asm/ucontext.h>
+#include <asm/byteorder.h>
 
 #include "hwprobe.h"
 #include "../../kselftest.h"
 
-#define MK_CBO(fn) cpu_to_le32((fn) << 20 | 10 << 15 | 2 << 12 | 0 << 7 | 15)
+#define MK_CBO(fn) __cpu_to_le32((fn) << 20 | 10 << 15 | 2 << 12 | 0 << 7 | 15)
 
 static char mem[4096] __aligned(4096) = { [0 ... 4095] = 0xa5 };
 
-- 
2.34.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

             reply	other threads:[~2024-03-21 11:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 11:52 woodrow.shen [this message]
2024-03-21 12:14 ` [PATCH] RISC-V: selftests: cbo: Use exported __cpu_to_le32() with uapi header Woodrow Shen
2024-03-22  8:40   ` Andrew Jones

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=20240321115250.801731-1-woodrow.shen@sifive.com \
    --to=woodrow.shen@sifive.com \
    --cc=linux-riscv@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;
as well as URLs for NNTP newsgroup(s).