Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: riscv: Add braces around EXPECT_EQ()

EXPECT_EQ() expands to multiple lines, breaking up one-line if
statements. This issue was not present in the patch on the mailing list
but was instead introduced by the maintainer when attempting to fix up
checkpatch warnings. Add braces around EXPECT_EQ() to avoid the error
even though checkpatch suggests them to be removed:

validate_v_ptrace.c:626:17: error: ‘else’ without a previous ‘if’

Fixes: 3789d5eecd5a ("selftests: riscv: verify syscalls discard vector context")
Fixes: 30eb191c895b ("selftests: riscv: verify ptrace rejects invalid vector csr inputs")
Fixes: 849f05ae1ea6 ("selftests: riscv: verify ptrace accepts valid vector csr values")
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Reviewed-and-tested-by: Sergey Matyukevich <geomatsi@gmail.com>
Link: https://patch.msgid.link/20260309-fix_selftests-v2-2-9d5a553a531e@gmail.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>

authored by

Charlie Jenkins and committed by
Paul Walmsley
511361fe 87ad7cc9

+9 -6
+9 -6
tools/testing/selftests/riscv/vector/validate_v_ptrace.c
··· 290 290 291 291 /* verify initial vsetvli settings */ 292 292 293 - if (is_xtheadvector_supported()) 293 + if (is_xtheadvector_supported()) { 294 294 EXPECT_EQ(5UL, regset_data->vtype); 295 - else 295 + } else { 296 296 EXPECT_EQ(9UL, regset_data->vtype); 297 + } 297 298 298 299 EXPECT_EQ(regset_data->vlenb, regset_data->vl); 299 300 EXPECT_EQ(vlenb, regset_data->vlenb); ··· 620 619 621 620 /* verify initial vsetvli settings */ 622 621 623 - if (is_xtheadvector_supported()) 622 + if (is_xtheadvector_supported()) { 624 623 EXPECT_EQ(5UL, regset_data->vtype); 625 - else 624 + } else { 626 625 EXPECT_EQ(9UL, regset_data->vtype); 626 + } 627 627 628 628 EXPECT_EQ(regset_data->vlenb, regset_data->vl); 629 629 EXPECT_EQ(vlenb, regset_data->vlenb); ··· 829 827 830 828 /* verify initial vsetvli settings */ 831 829 832 - if (is_xtheadvector_supported()) 830 + if (is_xtheadvector_supported()) { 833 831 EXPECT_EQ(5UL, regset_data->vtype); 834 - else 832 + } else { 835 833 EXPECT_EQ(9UL, regset_data->vtype); 834 + } 836 835 837 836 EXPECT_EQ(regset_data->vlenb, regset_data->vl); 838 837 EXPECT_EQ(vlenb, regset_data->vlenb);