Skip to contentSkip to conversation

bpf_prog05: Use 64bit wide integer constant on m32

PATCH New Richard Palethorpe 2 participants 2 messages May 7, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf_prog05: Use 64bit wide integer constant on m32

On 32bit 1UL is only 32bits wide. We need it to be 64bits.

---
 testcases/kernel/syscalls/bpf/bpf_prog05.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/bpf/bpf_prog05.c +2 -2
index f2e0e4698..2dce72ee8 100644
@@ -142,11 +142,11 @@ static void run(void)
 	*key = 0;
 
 	tst_res(TINFO, "Check w7(-1) /= w6(0) [r7 = -1, r6 = 1 << 32]");
-	expect_reg_val("src(r6)", 1UL << 32);
+	expect_reg_val("src(r6)", 1ULL << 32);
 	expect_reg_val("dst(r7)", 0);
 
 	tst_res(TINFO, "Check w7(-1) %%= w6(0) [r7 = -1, r6 = 1 << 32]");
-	expect_reg_val("src(r6)", 1UL << 32);
+	expect_reg_val("src(r6)", 1ULL << 32);
 	expect_reg_val("dst(r7)", (uint32_t)-1);
 
 	SAFE_CLOSE(map_fd);
Signature · 1 line
2.31.1
Applied
#1 lore raw

PATCH 1/1 bpf_prog05: Use 64bit wide integer constant on m32

Hi Richie,

Quoted 1 line

On 32bit 1UL is only 32bits wide. We need it to be 64bits.

Merged, thanks!

Kind regards,
Petr