[LTP] [PATCH] input_helper: Modify the check range of the input event number

Kogure Akihisa ( 小暮 明久 ) akihisa.kogure.ke@kyocera.jp
Tue Mar 26 01:24:19 CET 2024


If the input event number is greater than 32, the newly added event ID
will be 256 or later.
When there were already 32 input events in the device, this test program
only checked 0~99, so it failed because it could not find a new input
event ID.

In order to eliminate this failure, we changed the event ID range to be
checked by this test program to 0~356 (256+100).

Bug: 330269984
Test: ltp
Change-Id: I1b53008b15641fcdccf214af9183de1c29a3309c
---

diff --git a/testcases/kernel/input/input_helper.c b/testcases/kernel/input/input_helper.c
index c929de6..f086ae5 100644
--- a/testcases/kernel/input/input_helper.c
+++ b/testcases/kernel/input/input_helper.c
@@ -41,7 +41,7 @@
      int ret, fd = -1;
      unsigned int i;

-     for (i = 0; i < 100; i++) {
+     for (i = 0; i < 356; i++) {
            snprintf(path, sizeof(path), "/dev/input/event%i", i);

            fd = open(path, O_RDONLY);



More information about the ltp mailing list