Skip to content

Commit

Permalink
RISC-V: selftests: cbo: Use exported __cpu_to_le32() with uapi header
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
  • Loading branch information
woodrow-shen authored and Björn Töpel committed Mar 25, 2024
1 parent 8e18642 commit 0f84556
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/testing/selftests/riscv/hwprobe/cbo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down

0 comments on commit 0f84556

Please sign in to comment.