Skip to contentSkip to conversation

Replaced the calls to strict_strtoul() in the line6 driver

PATCH New Johannes Thumshirn 1 participant 10 messages Jun 27, 2012 Staging

lore
Share & tools
lore
#0 lore raw

cover Replaced the calls to strict_strtoul() in the line6 driver

Replaced the strict_strtoul() calls in the line6 driver and adopted the interfaces of some functions functions affected by the changes.

Johannes Thumshirn (9):
staging: line6: changed interface of line6_transmit_parameter()
staging: line6: Changed some strict_strtouls to kstrtou8
staging: line6: changed interface of line6_pod_transmit_parameter()
staging: line6: adjusted interface of line6_send_program()
staging: line6: changed interface of pod_send_channel()
staging: line6: control.c eliminate strict_strtoul() in

    pod_set_param_int()
  staging: line6: Exchanged strict_strtoul with kstrtou8() in
    pod.c:pod_resolve()

staging: line6: Changed strict_strtoul() to kstrtou8() in
pod_set_channel()
staging: line6: Changed strict_strtoul() to kstrtou8() in
pod_set_midi_postprocess()

 drivers/staging/line6/control.c |    4 ++--
 drivers/staging/line6/driver.c  |    4 ++--
 drivers/staging/line6/driver.h  |    4 ++--
 drivers/staging/line6/pod.c     |   16 ++++++++--------
 drivers/staging/line6/pod.h     |    2 +-
 drivers/staging/line6/variax.c  |    8 ++++----
 6 files changed, 19 insertions(+), 19 deletions(-)
Signature · 1 line
1.7.7.6
#2 lore raw

PATCH 2/9 staging: line6: Changed some strict_strtouls to kstrtou8

Adjusted strict_strtoul calls to kstrtou8 in order to take the changes of line6_transmit_parameter() into account.

---
 drivers/staging/line6/variax.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/line6/variax.c +4 -4
index efa496d..f97416b 100644
@@ -319,10 +319,10 @@ static ssize_t variax_set_volume(struct device *dev,
 {
 	struct usb_line6_variax *variax =
 	    usb_get_intfdata(to_usb_interface(dev));
-	unsigned long value;
+	u8 value;
 	int ret;
 
-	ret = strict_strtoul(buf, 10, &value);
+	ret = kstrtou8(buf, 10, &value);
 	if (ret)
 		return ret;
 
@@ -418,10 +418,10 @@ static ssize_t variax_set_tone(struct device *dev,
 {
 	struct usb_line6_variax *variax =
 	    usb_get_intfdata(to_usb_interface(dev));
-	unsigned long value;
+	u8 value;
 	int ret;
 
-	ret = strict_strtoul(buf, 10, &value);
+	ret = kstrtou8(buf, 10, &value);
 	if (ret)
 		return ret;
 
Signature · 1 line
1.7.7.6
#4 lore raw

PATCH 4/9 staging: line6: adjusted interface of line6_send_program()

In reply to Johannes Thumshirn

Adjusted interface of line6_send_program() to clarify internal working

---
 drivers/staging/line6/driver.c |    2 +-
 drivers/staging/line6/driver.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/line6/driver.c +1 -1
index d861230..b8358ca 100644
@@ -490,7 +490,7 @@ static void line6_data_received(struct urb *urb)
 /*
 	Send channel number (i.e., switch to a different sound).
 */
-int line6_send_program(struct usb_line6 *line6, int value)
+int line6_send_program(struct usb_line6 *line6, u8 value)
 {
 	int retval;
 	unsigned char *buffer;
drivers/staging/line6/driver.h +1 -1
index 140ccfe..a3029eb 100644
@@ -209,7 +209,7 @@ extern int line6_read_data(struct usb_line6 *line6, int address, void *data,
 			   size_t datalen);
 extern int line6_read_serial_number(struct usb_line6 *line6,
 				    int *serial_number);
-extern int line6_send_program(struct usb_line6 *line6, int value);
+extern int line6_send_program(struct usb_line6 *line6, u8 value);
 extern int line6_send_raw_message(struct usb_line6 *line6, const char *buffer,
 				  int size);
 extern int line6_send_raw_message_async(struct usb_line6 *line6,
Signature · 1 line
1.7.7.6
#5 lore raw

PATCH 5/9 staging: line6: changed interface of pod_send_channel()

In reply to Johannes Thumshirn

Adjusted interface of pod_send_channel() in order to take changes of line6_send_program() into account.

---
 drivers/staging/line6/pod.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/line6/pod.c +1 -1
index 8667aaf..459f325 100644
@@ -405,7 +405,7 @@ void line6_pod_midi_postprocess(struct usb_line6_pod *pod, unsigned char *data,
 /*
 	Send channel number (i.e., switch to a different sound).
 */
-static void pod_send_channel(struct usb_line6_pod *pod, int value)
+static void pod_send_channel(struct usb_line6_pod *pod, u8 value)
 {
 	line6_invalidate_current(&pod->dumpreq);
 
Signature · 1 line
1.7.7.6
#6 lore raw

PATCH 6/9 staging: line6: control.c eliminate strict_strtoul() in pod_set_param_int()

In reply to Johannes Thumshirn

Exchange strict_strtoul() with kstrtou8() and make "value" a u8 instead of a unsigned long. This is also needed for the changed line6_pod_transmit_parameter().

---
 drivers/staging/line6/control.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/line6/control.c +2 -2
index 67e23b6..f8326f5 100644
@@ -55,10 +55,10 @@ static ssize_t pod_set_param_int(struct device *dev, const char *buf,
 {
 	struct usb_interface *interface = to_usb_interface(dev);
 	struct usb_line6_pod *pod = usb_get_intfdata(interface);
-	unsigned long value;
+	u8 value;
 	int retval;
 
-	retval = strict_strtoul(buf, 10, &value);
+	retval = kstrtou8(buf, 10, &value);
 	if (retval)
 		return retval;
 
Signature · 1 line
1.7.7.6
#9 lore raw

PATCH 9/9 staging: line6: Changed strict_strtoul() to kstrtou8() in pod_set_midi_postprocess()

In reply to Johannes Thumshirn

Changed a call to strict_strtoul() into kstrtou8() in pod_set_midi_postprocess().

---
 drivers/staging/line6/pod.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/line6/pod.c +2 -2
index 2a85ec3..9edd053 100644
@@ -892,10 +892,10 @@ static ssize_t pod_set_midi_postprocess(struct device *dev,
 {
 	struct usb_interface *interface = to_usb_interface(dev);
 	struct usb_line6_pod *pod = usb_get_intfdata(interface);
-	unsigned long value;
+	u8 value;
 	int ret;
 
-	ret = strict_strtoul(buf, 10, &value);
+	ret = kstrtou8(buf, 10, &value);
 	if (ret)
 		return ret;
 
Signature · 1 line
1.7.7.6
#8 lore raw

PATCH 8/9 staging: line6: Changed strict_strtoul() to kstrtou8() in pod_set_channel()

In reply to Johannes Thumshirn

Changed strict_strtoul() to kstrtou() in pod_set_channel() to take changes in pod_send_channel() into account.

---
 drivers/staging/line6/pod.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/line6/pod.c +2 -2
index 4c81914..2a85ec3 100644
@@ -560,10 +560,10 @@ static ssize_t pod_set_channel(struct device *dev,
 {
 	struct usb_interface *interface = to_usb_interface(dev);
 	struct usb_line6_pod *pod = usb_get_intfdata(interface);
-	unsigned long value;
+	u8 value;
 	int ret;
 
-	ret = strict_strtoul(buf, 10, &value);
+	ret = kstrtou8(buf, 10, &value);
 	if (ret)
 		return ret;
 
Signature · 1 line
1.7.7.6
#7 lore raw

PATCH 7/9 staging: line6: Exchanged strict_strtoul with kstrtou8() in pod.c:pod_resolve()

In reply to Johannes Thumshirn

Exchanged call to strict_strtoul() with kstrtou8() in pod_resolve().

---
 drivers/staging/line6/pod.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/line6/pod.c +2 -2
index 459f325..4c81914 100644
@@ -434,11 +434,11 @@ void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param,
 static int pod_resolve(const char *buf, short block0, short block1,
 		       unsigned char *location)
 {
-	unsigned long value;
+	u8 value;
 	short block;
 	int ret;
 
-	ret = strict_strtoul(buf, 10, &value);
+	ret = kstrtou8(buf, 10, &value);
 	if (ret)
 		return ret;
 
Signature · 1 line
1.7.7.6
#3 lore raw

PATCH 3/9 staging: line6: changed interface of line6_pod_transmit_parameter()

In reply to Johannes Thumshirn

Adjusted interface of line6_pod_transmit_parameter() to take changes of line6_transmit_parameter() into account

---
 drivers/staging/line6/pod.c |    2 +-
 drivers/staging/line6/pod.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/line6/pod.c +1 -1
index 4dadc57..8667aaf 100644
@@ -419,7 +419,7 @@ static void pod_send_channel(struct usb_line6_pod *pod, int value)
 	Transmit PODxt Pro control parameter.
 */
 void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param,
-				  int value)
+				  u8 value)
 {
 	if (line6_transmit_parameter(&pod->line6, param, value) == 0)
 		pod_store_parameter(pod, param, value);
drivers/staging/line6/pod.h +1 -1
index 18b9d08..47e0d1a 100644
@@ -200,6 +200,6 @@ extern void line6_pod_midi_postprocess(struct usb_line6_pod *pod,
 				       unsigned char *data, int length);
 extern void line6_pod_process_message(struct usb_line6_pod *pod);
 extern void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param,
-					 int value);
+					 u8 value);
 
 #endif
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH 1/9 staging: line6: changed interface of line6_transmit_parameter()

In reply to Johannes Thumshirn

Interface of line6_transmit_parameter() adjusted to clarify internal workings

---
 drivers/staging/line6/driver.c |    2 +-
 drivers/staging/line6/driver.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/line6/driver.c +1 -1
index 4513f78..d861230 100644
@@ -526,7 +526,7 @@ int line6_send_program(struct usb_line6 *line6, int value)
 /*
 	Transmit Line6 control parameter.
 */
-int line6_transmit_parameter(struct usb_line6 *line6, int param, int value)
+int line6_transmit_parameter(struct usb_line6 *line6, int param, u8 value)
 {
 	int retval;
 	unsigned char *buffer;
drivers/staging/line6/driver.h +1 -1
index 117bf99..140ccfe 100644
@@ -224,7 +224,7 @@ extern void line6_start_timer(struct timer_list *timer, unsigned int msecs,
 			      void (*function) (unsigned long),
 			      unsigned long data);
 extern int line6_transmit_parameter(struct usb_line6 *line6, int param,
-				    int value);
+				    u8 value);
 extern int line6_version_request_async(struct usb_line6 *line6);
 extern int line6_write_data(struct usb_line6 *line6, int address, void *data,
 			    size_t datalen);
Signature · 1 line
1.7.7.6