* [PATCH] Input: automatically set EV_ABS bit in input_set_abs_params
@ 2014-10-08 16:54 Dmitry Torokhov
2014-10-08 17:09 ` David Herrmann
2014-10-10 11:30 ` Jiri Kosina
0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2014-10-08 16:54 UTC (permalink / raw)
To: linux-input
Cc: Henrik Rydberg, Hans de Goede, David Herrmann, Benjamin Tissoires,
jikos, linux-kernel
Let's automatically set EV_ABS bit in device's event type list when calling
input_set_abs_params() so that drivers do not have to do it explicitly.
These calls are never in a hot paths so we won't lose much time by setting
the same bit several times.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/input.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 29ca0bb..d2e06cc 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -498,7 +498,8 @@ void input_set_abs_params(struct input_dev *dev, unsigned int axis,
absinfo->fuzz = fuzz;
absinfo->flat = flat;
- dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
+ __set_bit(EV_ABS, dev->evbit);
+ __set_bit(axis, dev->absbit);
}
EXPORT_SYMBOL(input_set_abs_params);
--
Dmitry
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Input: automatically set EV_ABS bit in input_set_abs_params
2014-10-08 16:54 [PATCH] Input: automatically set EV_ABS bit in input_set_abs_params Dmitry Torokhov
@ 2014-10-08 17:09 ` David Herrmann
2014-10-10 11:30 ` Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: David Herrmann @ 2014-10-08 17:09 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: open list:HID CORE LAYER, Henrik Rydberg, Hans de Goede,
Benjamin Tissoires, jikos, linux-kernel
Hi
On Wed, Oct 8, 2014 at 6:54 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Let's automatically set EV_ABS bit in device's event type list when calling
> input_set_abs_params() so that drivers do not have to do it explicitly.
>
> These calls are never in a hot paths so we won't lose much time by setting
> the same bit several times.
Looks good to me. I mean we already do the absbit-allocation here, so
this looks sane to do.
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Thanks
David
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> drivers/input/input.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index 29ca0bb..d2e06cc 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -498,7 +498,8 @@ void input_set_abs_params(struct input_dev *dev, unsigned int axis,
> absinfo->fuzz = fuzz;
> absinfo->flat = flat;
>
> - dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
> + __set_bit(EV_ABS, dev->evbit);
> + __set_bit(axis, dev->absbit);
> }
> EXPORT_SYMBOL(input_set_abs_params);
>
>
> --
> Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Input: automatically set EV_ABS bit in input_set_abs_params
2014-10-08 16:54 [PATCH] Input: automatically set EV_ABS bit in input_set_abs_params Dmitry Torokhov
2014-10-08 17:09 ` David Herrmann
@ 2014-10-10 11:30 ` Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2014-10-10 11:30 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, Henrik Rydberg, Hans de Goede, David Herrmann,
Benjamin Tissoires, linux-kernel
On Wed, 8 Oct 2014, Dmitry Torokhov wrote:
> Let's automatically set EV_ABS bit in device's event type list when calling
> input_set_abs_params() so that drivers do not have to do it explicitly.
>
> These calls are never in a hot paths so we won't lose much time by setting
> the same bit several times.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Makes sense.
Acked-by: Jiri Kosina <jkosina@suse.cz>
Thanks.
> ---
> drivers/input/input.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index 29ca0bb..d2e06cc 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -498,7 +498,8 @@ void input_set_abs_params(struct input_dev *dev, unsigned int axis,
> absinfo->fuzz = fuzz;
> absinfo->flat = flat;
>
> - dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
> + __set_bit(EV_ABS, dev->evbit);
> + __set_bit(axis, dev->absbit);
> }
> EXPORT_SYMBOL(input_set_abs_params);
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-10 11:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-08 16:54 [PATCH] Input: automatically set EV_ABS bit in input_set_abs_params Dmitry Torokhov
2014-10-08 17:09 ` David Herrmann
2014-10-10 11:30 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox