diff mbox series

[GIT,PULL] Kselftest fixes update for Linux 6.6-rc7

Message ID 817898d0-dbe1-4016-af10-abd1731748ea@linuxfoundation.org (mailing list archive)
State Accepted
Commit 444ccf1b11a0dbc54e789d6d2634c2649dc27498
Headers show
Series [GIT,PULL] Kselftest fixes update for Linux 6.6-rc7 | expand

Pull-request

git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest_active-fixes-6.6-rc7

Commit Message

Shuah Khan Oct. 20, 2023, 5:20 p.m. UTC
Hi Linus,

Please pull the following Kselftest fixes update for Linux 6.6-rc7.

This Kselftest update for Linux 6.6-rc7 consists of one single fix
to assert check in user_events abi_test to properly check bit value
on Big Endian architectures. The current code treats the bit values
as Little Endian and the check fails on Big Endian.

diff is attached.

thanks,
-- Shuah

----------------------------------------------------------------
The following changes since commit 6f874fa021dfc7bf37f4f37da3a5aaa41fe9c39c:

   selftests: Fix wrong TARGET in kselftest top level Makefile (2023-09-26 18:47:37 -0600)

are available in the Git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest_active-fixes-6.6-rc7

for you to fetch changes up to cf5a103c98a6fb9ee3164334cb5502df6360749b:

   selftests/user_events: Fix abi_test for BE archs (2023-10-17 15:07:19 -0600)

----------------------------------------------------------------
linux_kselftest_active-fixes-6.6-rc7

This Kselftest update for Linux 6.6-rc7 consists of one single fix
to assert check in user_events abi_test to properly check bit value
on Big Endian architectures. The current code treats the bit values
as Little Endian and the check fails on Big Endian.

----------------------------------------------------------------
Beau Belgrave (1):
       selftests/user_events: Fix abi_test for BE archs

  tools/testing/selftests/user_events/abi_test.c | 16 +++++++++-------
  1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------

Comments

pr-tracker-bot@kernel.org Oct. 20, 2023, 9:53 p.m. UTC | #1
The pull request you sent on Fri, 20 Oct 2023 11:20:00 -0600:

> git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest_active-fixes-6.6-rc7

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/444ccf1b11a0dbc54e789d6d2634c2649dc27498

Thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/user_events/abi_test.c b/tools/testing/selftests/user_events/abi_test.c
index 8202f1327c39..f5575ef2007c 100644
--- a/tools/testing/selftests/user_events/abi_test.c
+++ b/tools/testing/selftests/user_events/abi_test.c
@@ -47,7 +47,7 @@  static int change_event(bool enable)
 	return ret;
 }
 
-static int reg_enable(long *enable, int size, int bit)
+static int reg_enable(void *enable, int size, int bit)
 {
 	struct user_reg reg = {0};
 	int fd = open(data_file, O_RDWR);
@@ -69,7 +69,7 @@  static int reg_enable(long *enable, int size, int bit)
 	return ret;
 }
 
-static int reg_disable(long *enable, int bit)
+static int reg_disable(void *enable, int bit)
 {
 	struct user_unreg reg = {0};
 	int fd = open(data_file, O_RDWR);
@@ -90,7 +90,8 @@  static int reg_disable(long *enable, int bit)
 }
 
 FIXTURE(user) {
-	long check;
+	int check;
+	long check_long;
 	bool umount;
 };
 
@@ -99,6 +100,7 @@  FIXTURE_SETUP(user) {
 
 	change_event(false);
 	self->check = 0;
+	self->check_long = 0;
 }
 
 FIXTURE_TEARDOWN(user) {
@@ -136,9 +138,9 @@  TEST_F(user, bit_sizes) {
 
 #if BITS_PER_LONG == 8
 	/* Allow 0-64 bits for 64-bit */
-	ASSERT_EQ(0, reg_enable(&self->check, sizeof(long), 63));
-	ASSERT_NE(0, reg_enable(&self->check, sizeof(long), 64));
-	ASSERT_EQ(0, reg_disable(&self->check, 63));
+	ASSERT_EQ(0, reg_enable(&self->check_long, sizeof(long), 63));
+	ASSERT_NE(0, reg_enable(&self->check_long, sizeof(long), 64));
+	ASSERT_EQ(0, reg_disable(&self->check_long, 63));
 #endif
 
 	/* Disallowed sizes (everything beside 4 and 8) */
@@ -200,7 +202,7 @@  static int clone_check(void *check)
 	for (i = 0; i < 10; ++i) {
 		usleep(100000);
 
-		if (*(long *)check)
+		if (*(int *)check)
 			return 0;
 	}