From 57d94d26ed42773d6378da45eed9de03b116e7f7 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Tue, 3 Nov 2026 09:16:27 -0500 Subject: [PATCH] selftests/configfs: fix the build on 32-bit architectures The fixture setup checks the result of mkdtemp() with ASSERT_NE(), which hands the pointer to the harness. The harness casts both operands to intmax_t to print them, and on 32-bit architectures gcc warns about the cast from a pointer to an integer of a different size. The configfs test builds with -Werror, so it fails to build there: kselftest_harness.h:797:49: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] Compare the result against NULL inside ASSERT_TRUE(), so that the harness only sees an int. Fixes: a7fdcb2edd0f ("selftests/configfs: add tests for the userspace interface") Signed-off-by: Sasha Levin Reviewed-by: Breno Leitao Link: https://patch.msgid.link/20261103141627.30838-1-sashal@kernel.org Signed-off-by: Breno Leitao --- tools/testing/selftests/filesystems/configfs/configfs_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/filesystems/configfs/configfs_test.c b/tools/testing/selftests/filesystems/configfs/configfs_test.c index c6a1049e5852..94ae8f710309 100644 --- a/tools/testing/selftests/filesystems/configfs/configfs_test.c +++ b/tools/testing/selftests/filesystems/configfs/configfs_test.c @@ -122,7 +122,7 @@ FIXTURE_SETUP(configfs) ASSERT_EQ(unshare(CLONE_NEWNS), 0); ASSERT_EQ(mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL), 0); - ASSERT_NE(mkdtemp(tmpl), NULL); + ASSERT_TRUE(mkdtemp(tmpl) != NULL); strcpy(self->mnt, tmpl); ASSERT_EQ(mount("configfs", self->mnt, "configfs", 0, NULL), 0);