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:	Tue, 6 Jan 2015 23:57:03 -0800
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Olliver Schinagl <oliver+list@...inagl.nl>
Cc:	Wolfram Sang <wsa@...-dreams.de>,
	Paul Gortmaker <paul.gortmaker@...driver.com>,
	Jingoo Han <jg1.han@...sung.com>,
	"David S. Miller" <davem@...emloft.net>,
	Sam Ravnborg <sam@...nborg.org>,
	Olliver Schinagl <oliver@...inagl.nl>,
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] input: make use of the input_set_capability helper

Hi Olliver,

On Wed, Jan 07, 2015 at 08:31:06AM +0100, Olliver Schinagl wrote:
> From: Olliver Schinagl <oliver@...inagl.nl>
> 
> Almost all of the speaker drivers under input manipulate the ev bits
> directly, which is not needed, as there is a helper available.
> 
> This patch makes use of the helper for the speaker drivers.
> 
> Signed-off-by: Olliver Schinagl <oliver@...inagl.nl>
> ---
>  drivers/input/misc/cm109.c         | 4 ++--
>  drivers/input/misc/ixp4xx-beeper.c | 5 ++---
>  drivers/input/misc/m68kspkr.c      | 5 ++---
>  drivers/input/misc/pcspkr.c        | 5 ++---
>  drivers/input/misc/pwm-beeper.c    | 5 +----
>  drivers/input/misc/sparcspkr.c     | 6 ++----
>  6 files changed, 11 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
> index 9365535..8e41070 100644
> --- a/drivers/input/misc/cm109.c
> +++ b/drivers/input/misc/cm109.c
> @@ -767,10 +767,10 @@ static int cm109_usb_probe(struct usb_interface *intf,
>  	input_dev->keycodesize = sizeof(unsigned char);
>  	input_dev->keycodemax = ARRAY_SIZE(dev->keymap);
>  
> -	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_SND);
> -	input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
> +	input_set_capability(input_dev, EV_SND, SND_BELL | SND_TONE);

No, input_set_capability() takes single event code, not bitmask. The
fact that it works for these 2 values of SND events is pure coincidence
(the old code wasn't much better though).

>  
>  	/* register available key events */
> +	input_dev->evbit[0] = BIT_MASK(EV_KEY);

Would prefer __set_bit(EV_KEY, input_dev->evbit); here instead.

Thanks.

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