* [LTP] [PATCH] input_helper: Modify the check range of the input event number
@ 2024-03-26 0:24 Kogure Akihisa ( 小暮 明久 )
2024-03-26 14:23 ` Cyril Hrubis
0 siblings, 1 reply; 5+ messages in thread
From: Kogure Akihisa ( 小暮 明久 ) @ 2024-03-26 0:24 UTC (permalink / raw)
To: ltp@lists.linux.it
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);
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] input_helper: Modify the check range of the input event number
2024-03-26 0:24 [LTP] [PATCH] input_helper: Modify the check range of the input event number Kogure Akihisa ( 小暮 明久 )
@ 2024-03-26 14:23 ` Cyril Hrubis
2024-03-26 14:37 ` Cyril Hrubis
0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2024-03-26 14:23 UTC (permalink / raw)
To: Kogure Akihisa ( 小暮 明久 )
Cc: ltp@lists.linux.it
Hi!
> If the input event number is greater than 32, the newly added event ID
> will be 256 or later.
I've tried it and it seems to work that way, but it strange why these
are numbered discontinously. May be even a bug.
> 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).
I guess that since we are changing the code we can as well add a bigger
value there. Let's bump it at least ten times so that we don't have to
change it again later on.
> 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);
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] input_helper: Modify the check range of the input event number
2024-03-26 14:23 ` Cyril Hrubis
@ 2024-03-26 14:37 ` Cyril Hrubis
2024-03-27 1:26 ` Kogure Akihisa ( 小暮 明久 )
0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2024-03-26 14:37 UTC (permalink / raw)
To: Kogure Akihisa ( 小暮 明久 )
Cc: ltp@lists.linux.it
Hi!
> > If the input event number is greater than 32, the newly added event ID
> > will be 256 or later.
>
> I've tried it and it seems to work that way, but it strange why these
> are numbered discontinously. May be even a bug.
And apparently this is intentional:
commit 7f8d4cad1e4e11a45d02bd6e024cc2812963c38a
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: Mon Oct 8 09:07:24 2012 -0700
Input: extend the number of event (and other) devices
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] input_helper: Modify the check range of the input event number
2024-03-26 14:37 ` Cyril Hrubis
@ 2024-03-27 1:26 ` Kogure Akihisa ( 小暮 明久 )
2024-03-28 10:42 ` Petr Vorel
0 siblings, 1 reply; 5+ messages in thread
From: Kogure Akihisa ( 小暮 明久 ) @ 2024-03-27 1:26 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp@lists.linux.it
Hi !
> I guess that since we are changing the code we can as well add a bigger
> value there. Let's bump it at least ten times so that we don't have to
> change it again later on.
The following commit was set to 1023 for the upper limit of event IDs, so we changed it to check up to 0-1023.
https://github.com/torvalds/linux/commit/7f8d4cad1e4e11a45d02bd6e024cc2812963c38a
---
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~1023.
(https://github.com/torvalds/linux/commit/7f8d4cad1e4e11a45d02bd6e024cc2812963c38a, it looks like the upper limit should be 1023.)
---
diff --git a/testcases/kernel/input/input_helper.c b/testcases/kernel/input/input_helper.c
index 09530fb..6b60d17 100644
--- a/testcases/kernel/input/input_helper.c
+++ b/testcases/kernel/input/input_helper.c
@@ -40,7 +40,7 @@
int ret, fd = -1;
unsigned int i;
- for (i = 0; i < 100; i++) {
+ for (i = 0; i < 1024; i++) {
snprintf(path, sizeof(path), "/dev/input/event%i", i);
fd = open(path, O_RDONLY);
---
Akihisa Kogure
akihisa.kogure.ke@kyocera.jp
________________________________
差出人: Cyril Hrubis <chrubis@suse.cz>
送信日時: 2024年3月26日 23:37
宛先: Kogure Akihisa ( 小暮 明久 ) <akihisa.kogure.ke@kyocera.jp>
CC: ltp@lists.linux.it <ltp@lists.linux.it>
件名: Re: [LTP] [PATCH] input_helper: Modify the check range of the input event number
Hi!
> > If the input event number is greater than 32, the newly added event ID
> > will be 256 or later.
>
> I've tried it and it seems to work that way, but it strange why these
> are numbered discontinously. May be even a bug.
And apparently this is intentional:
commit 7f8d4cad1e4e11a45d02bd6e024cc2812963c38a
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: Mon Oct 8 09:07:24 2012 -0700
Input: extend the number of event (and other) devices
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] input_helper: Modify the check range of the input event number
2024-03-27 1:26 ` Kogure Akihisa ( 小暮 明久 )
@ 2024-03-28 10:42 ` Petr Vorel
0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2024-03-28 10:42 UTC (permalink / raw)
To: Kogure Akihisa ( 小暮 明久 )
Cc: ltp@lists.linux.it
Hi,
> 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~1023.
> (https://github.com/torvalds/linux/commit/7f8d4cad1e4e11a45d02bd6e024cc2812963c38a, it looks like the upper limit should be 1023.)
For 1024:
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Ideally you would send v2, but we can also update the commit message and code
before merge.
Kind regards,
Petr
> ---
> diff --git a/testcases/kernel/input/input_helper.c b/testcases/kernel/input/input_helper.c
> index 09530fb..6b60d17 100644
> --- a/testcases/kernel/input/input_helper.c
> +++ b/testcases/kernel/input/input_helper.c
> @@ -40,7 +40,7 @@
> int ret, fd = -1;
> unsigned int i;
> - for (i = 0; i < 100; i++) {
> + for (i = 0; i < 1024; i++) {
> snprintf(path, sizeof(path), "/dev/input/event%i", i);
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-03-28 10:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-26 0:24 [LTP] [PATCH] input_helper: Modify the check range of the input event number Kogure Akihisa ( 小暮 明久 )
2024-03-26 14:23 ` Cyril Hrubis
2024-03-26 14:37 ` Cyril Hrubis
2024-03-27 1:26 ` Kogure Akihisa ( 小暮 明久 )
2024-03-28 10:42 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox