From: Shawn Bohrer <shawn.bohrer@gmail.com>
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Shawn Bohrer <shawn.bohrer@gmail.com>
Subject: [PATCH 11/13] staging: line6: Convert simple_strtoul to strict_strtoul in variax.c
Date: Sun, 15 Nov 2009 22:18:00 -0600 [thread overview]
Message-ID: <1258345082-11811-12-git-send-email-shawn.bohrer@gmail.com> (raw)
In-Reply-To: <1258345082-11811-1-git-send-email-shawn.bohrer@gmail.com>
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
---
drivers/staging/line6/variax.c | 31 ++++++++++++++++++++++++++-----
1 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c
index f9d9698..48d834b 100644
--- a/drivers/staging/line6/variax.c
+++ b/drivers/staging/line6/variax.c
@@ -184,7 +184,12 @@ static ssize_t variax_set_volume(struct device *dev,
const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
- int value = simple_strtoul(buf, NULL, 10);
+ unsigned long value;
+ int ret;
+
+ ret = strict_strtoul(buf, 10, &value);
+ if (ret)
+ return ret;
if (line6_transmit_parameter(&variax->line6, VARIAXMIDI_volume,
value) == 0)
@@ -211,7 +216,12 @@ static ssize_t variax_set_model(struct device *dev,
const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
- int value = simple_strtoul(buf, NULL, 10);
+ unsigned long value;
+ int ret;
+
+ ret = strict_strtoul(buf, 10, &value);
+ if (ret)
+ return ret;
if (line6_send_program(&variax->line6, value) == 0)
variax->model = value;
@@ -237,8 +247,14 @@ static ssize_t variax_set_active(struct device *dev,
const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
- int value = simple_strtoul(buf, NULL, 10) ? 1 : 0;
- variax->buffer_activate[VARIAX_OFFSET_ACTIVATE] = value;
+ unsigned long value;
+ int ret;
+
+ ret = strict_strtoul(buf, 10, &value);
+ if (ret)
+ return ret;
+
+ variax->buffer_activate[VARIAX_OFFSET_ACTIVATE] = value ? 1: 0;
line6_send_raw_message_async(&variax->line6, variax->buffer_activate,
sizeof(variax_activate));
return count;
@@ -262,7 +278,12 @@ static ssize_t variax_set_tone(struct device *dev,
const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
- int value = simple_strtoul(buf, NULL, 10);
+ unsigned long value;
+ int ret;
+
+ ret = strict_strtoul(buf, 10, &value);
+ if (ret)
+ return ret;
if (line6_transmit_parameter(&variax->line6, VARIAXMIDI_tone,
value) == 0)
--
1.6.5
next prev parent reply other threads:[~2009-11-16 4:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-16 4:17 [PATCH 00/13] staging: line6 cleanups Shawn Bohrer
2009-11-16 4:17 ` [PATCH 01/13] staging: line6: Lindent and fix checkpatch warnings in playback.c Shawn Bohrer
2009-11-16 4:17 ` [PATCH 02/13] staging: line6: Fix checkpatch errors " Shawn Bohrer
2009-11-16 4:17 ` [PATCH 03/13] staging: line6: Lindent and fix checkpatch warnings in capture.c Shawn Bohrer
2009-11-16 4:17 ` [PATCH 04/13] staging: line6: Fix checkpatch errors " Shawn Bohrer
2009-11-16 4:17 ` [PATCH 05/13] staging: line6: Lindent control.c Shawn Bohrer
2009-11-16 4:17 ` [PATCH 06/13] staging: line6: Fix some checkpatch warnings in control.c Shawn Bohrer
2009-11-16 4:17 ` [PATCH 07/13] staging: line6: Convert simple_strtoul() to strict_strtoul " Shawn Bohrer
2009-11-16 4:17 ` [PATCH 08/13] staging: line6: Fix checkpatch warnings in pcm.c Shawn Bohrer
2009-11-16 4:17 ` [PATCH 09/13] staging: line6: Lindent and fix some checkpatch warnings in toneport.c Shawn Bohrer
2009-11-16 4:17 ` [PATCH 10/13] staging: line6: Convert simple_strtol to strict_strtol " Shawn Bohrer
2009-11-16 4:18 ` Shawn Bohrer [this message]
2009-11-16 4:18 ` [PATCH 12/13] staging: line6: Convert simple_strtoul to strict_strtoul in pod.c Shawn Bohrer
2009-11-16 4:18 ` [PATCH 13/13] staging: line6: Convert simple_strtoul to strict_strtoul in midi.c Shawn Bohrer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1258345082-11811-12-git-send-email-shawn.bohrer@gmail.com \
--to=shawn.bohrer@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®