lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 8 Oct 2014 19:09:28 +0200
From:	David Herrmann <dh.herrmann@...il.com>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:	"open list:HID CORE LAYER" <linux-input@...r.kernel.org>,
	Henrik Rydberg <rydberg@...omail.se>,
	Hans de Goede <hdegoede@...hat.com>,
	Benjamin Tissoires <benjamin.tissoires@...il.com>,
	jikos@...os.cz, linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Input: automatically set EV_ABS bit in input_set_abs_params

Hi

On Wed, Oct 8, 2014 at 6:54 PM, Dmitry Torokhov
<dmitry.torokhov@...il.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@...il.com>

Thanks
David

> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ