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]
Message-Id: <201001071106.31688.dmitry.torokhov@gmail.com>
Date:	Thu, 7 Jan 2010 11:06:30 -0800
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Bastian Blank <waldi@...ian.org>
Cc:	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	Ping Cheng <pingc@...om.com>
Subject: Re: [PATCH 2/7] Input: wacom - Get features from driver info

On Thursday 07 January 2010 10:29:36 am Bastian Blank wrote:
> Get the features information from the driver info of the usb device id
> structure provided by the caller.  The device ids and feature structs
> are strong coupled using indices.
> 
> Signed-off-by: Bastian Blank <waldi@...ian.org>
> ---
>  drivers/input/tablet/wacom_sys.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/tablet/wacom_sys.c
>  b/drivers/input/tablet/wacom_sys.c index ab42c25..b0f3fc3 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -532,7 +532,7 @@ static int wacom_probe(struct usb_interface *intf,
>  const struct usb_device_id *i struct usb_endpoint_descriptor *endpoint;
>  	struct wacom *wacom;
>  	struct wacom_wac *wacom_wac;
> -	struct wacom_features *features;
> +	struct wacom_features *features = (void *)id->driver_info;

What is this cast for?

>  	struct input_dev *input_dev;
>  	int error = -ENOMEM;
> 
> @@ -557,7 +557,9 @@ static int wacom_probe(struct usb_interface *intf,
>  const struct usb_device_id *i usb_make_path(dev, wacom->phys,
>  sizeof(wacom->phys));
>  	strlcat(wacom->phys, "/input0", sizeof(wacom->phys));
> 
> -	wacom_wac->features = features = get_wacom_feature(id);
> +	if (!features)
> +		features = get_wacom_feature(id);

In which cases driver would not have driver_info set up?

> +	wacom_wac->features = features;
>  	BUG_ON(features->pktlen > WACOM_PKGLEN_MAX);
> 
>  	input_dev->name = wacom_wac->features->name;
> 

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