All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Correctly set data for USB request in case of a previous failure.
@ 2013-01-14 12:55 Hans Petter Selasky
  2013-01-14 15:06 ` Hans Petter Selasky
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Petter Selasky @ 2013-01-14 12:55 UTC (permalink / raw)
  To: linux-media

>From 89326793e2429dc55d951f336b3e3e3b73bedb95 Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <hselasky@c2i.net>
Date: Mon, 14 Jan 2013 13:53:21 +0100
Subject: [PATCH] Correctly set data for USB request in case of a previous
 failure.

Found-by: Jan Beich
Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
---
 drivers/input/tablet/wacom_sys.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index f92d34f..aaf23ae 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -553,10 +553,10 @@ static int wacom_set_device_mode(struct usb_interface *intf, int report_id, int
 	if (!rep_data)
 		return error;
 
-	rep_data[0] = report_id;
-	rep_data[1] = mode;
-
 	do {
+		rep_data[0] = report_id;
+		rep_data[1] = mode;
+
 		error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT,
 		                         report_id, rep_data, length, 1);
 		if (error >= 0)
-- 
1.7.11.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Correctly set data for USB request in case of a previous failure.
  2013-01-14 12:55 [PATCH] Correctly set data for USB request in case of a previous failure Hans Petter Selasky
@ 2013-01-14 15:06 ` Hans Petter Selasky
  2013-02-05 23:23   ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Petter Selasky @ 2013-01-14 15:06 UTC (permalink / raw)
  To: linux-media

Improved patch follows:

--HPS

>From a88d72d2108f92f004a3f050a708d9b7f661f924 Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <hselasky@c2i.net>
Date: Mon, 14 Jan 2013 13:53:21 +0100
Subject: [PATCH] Correctly initialize data for USB request.

Found-by: Jan Beich
Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
---
 drivers/input/tablet/wacom.h     | 1 +
 drivers/input/tablet/wacom_sys.c | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
index b79d451..d6fad87 100644
--- a/drivers/input/tablet/wacom.h
+++ b/drivers/input/tablet/wacom.h
@@ -89,6 +89,7 @@
 #include <linux/init.h>
 #include <linux/usb/input.h>
 #include <linux/power_supply.h>
+#include <linux/string.h>
 #include <asm/unaligned.h>
 
 /*
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index f92d34f..23bc71e 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -553,10 +553,12 @@ static int wacom_set_device_mode(struct usb_interface *intf, int report_id, int
 	if (!rep_data)
 		return error;
 
-	rep_data[0] = report_id;
-	rep_data[1] = mode;
-
 	do {
+		memset(rep_data, 0, length);
+
+		rep_data[0] = report_id;
+		rep_data[1] = mode;
+
 		error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT,
 		                         report_id, rep_data, length, 1);
 		if (error >= 0)
-- 
1.7.11.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Correctly set data for USB request in case of a previous failure.
  2013-01-14 15:06 ` Hans Petter Selasky
@ 2013-02-05 23:23   ` Mauro Carvalho Chehab
  2013-02-06  7:13     ` Hans Petter Selasky
  0 siblings, 1 reply; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2013-02-05 23:23 UTC (permalink / raw)
  To: Hans Petter Selasky; +Cc: linux-media

Em Mon, 14 Jan 2013 16:06:20 +0100
Hans Petter Selasky <hselasky@c2i.net> escreveu:

> Improved patch follows:

It would be even more improved if you send it to the right ML ;)

I suspect that your original intention were to send it to
linux-input ML, instead of linux-media :)

Regards,
Mauro

> 
> --HPS
> 
> From a88d72d2108f92f004a3f050a708d9b7f661f924 Mon Sep 17 00:00:00 2001
> From: Hans Petter Selasky <hselasky@c2i.net>
> Date: Mon, 14 Jan 2013 13:53:21 +0100
> Subject: [PATCH] Correctly initialize data for USB request.
> 
> Found-by: Jan Beich
> Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
> ---
>  drivers/input/tablet/wacom.h     | 1 +
>  drivers/input/tablet/wacom_sys.c | 8 +++++---
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
> index b79d451..d6fad87 100644
> --- a/drivers/input/tablet/wacom.h
> +++ b/drivers/input/tablet/wacom.h
> @@ -89,6 +89,7 @@
>  #include <linux/init.h>
>  #include <linux/usb/input.h>
>  #include <linux/power_supply.h>
> +#include <linux/string.h>
>  #include <asm/unaligned.h>
>  
>  /*
> diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
> index f92d34f..23bc71e 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -553,10 +553,12 @@ static int wacom_set_device_mode(struct usb_interface *intf, int report_id, int
>  	if (!rep_data)
>  		return error;
>  
> -	rep_data[0] = report_id;
> -	rep_data[1] = mode;
> -
>  	do {
> +		memset(rep_data, 0, length);
> +
> +		rep_data[0] = report_id;
> +		rep_data[1] = mode;
> +
>  		error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT,
>  		                         report_id, rep_data, length, 1);
>  		if (error >= 0)


-- 

Cheers,
Mauro

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Correctly set data for USB request in case of a previous failure.
  2013-02-05 23:23   ` Mauro Carvalho Chehab
@ 2013-02-06  7:13     ` Hans Petter Selasky
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Petter Selasky @ 2013-02-06  7:13 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media

On Wednesday 06 February 2013 00:23:08 Mauro Carvalho Chehab wrote:
> Em Mon, 14 Jan 2013 16:06:20 +0100
> 
> Hans Petter Selasky <hselasky@c2i.net> escreveu:
> > Improved patch follows:
> It would be even more improved if you send it to the right ML ;)
> 
> I suspect that your original intention were to send it to
> linux-input ML, instead of linux-media :)

Ok, will do. Thanks!

--HPS

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Correctly set data for USB request in case of a previous failure.
@ 2013-02-06  7:12 Hans Petter Selasky
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Petter Selasky @ 2013-02-06  7:12 UTC (permalink / raw)
  To: linux-input

>From a88d72d2108f92f004a3f050a708d9b7f661f924 Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <hselasky@c2i.net>
Date: Mon, 14 Jan 2013 13:53:21 +0100
Subject: [PATCH] Correctly initialize data for USB request.

Found-by: Jan Beich
Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
---
 drivers/input/tablet/wacom.h     | 1 +
 drivers/input/tablet/wacom_sys.c | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
index b79d451..d6fad87 100644
--- a/drivers/input/tablet/wacom.h
+++ b/drivers/input/tablet/wacom.h
@@ -89,6 +89,7 @@
 #include <linux/init.h>
 #include <linux/usb/input.h>
 #include <linux/power_supply.h>
+#include <linux/string.h>
 #include <asm/unaligned.h>
 
 /*
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index f92d34f..23bc71e 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -553,10 +553,12 @@ static int wacom_set_device_mode(struct usb_interface *intf, int report_id, int
 	if (!rep_data)
 		return error;
 
-	rep_data[0] = report_id;
-	rep_data[1] = mode;
-
 	do {
+		memset(rep_data, 0, length);
+
+		rep_data[0] = report_id;
+		rep_data[1] = mode;
+
 		error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT,
 		                         report_id, rep_data, length, 1);
 		if (error >= 0)
-- 
1.7.11.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-06  7:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-14 12:55 [PATCH] Correctly set data for USB request in case of a previous failure Hans Petter Selasky
2013-01-14 15:06 ` Hans Petter Selasky
2013-02-05 23:23   ` Mauro Carvalho Chehab
2013-02-06  7:13     ` Hans Petter Selasky
2013-02-06  7:12 Hans Petter Selasky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.