Re: [PATCH] Input: automatically set EV_ABS bit in input_set_abs_params

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

Makes sense.

	Acked-by: Jiri Kosina <jkosina@xxxxxxx>

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
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux