public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Laurent Navet [Mali]" <laurent.navet@gmail.com>
To: devel@driverdev.osuosl.org
Cc: line6linux-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
	"Laurent Navet [Mali]" <laurent.navet@gmail.com>
Subject: [PATCH] staging: line6: use kstrtoint() instead of simple_strtoul()
Date: Thu, 29 Nov 2012 21:03:38 +0100	[thread overview]
Message-ID: <1354219418-6882-1-git-send-email-laurent.navet@gmail.com> (raw)

From: "Laurent Navet [Mali]" <laurent.navet@gmail.com>

staging: line6: pcm.c
	call to obsolete simple_strtoul() function is replaced
        by kstrtoint() in pcm_set_impulse_period().
	Also check the return code.

Signed-off-by: Laurent Navet [Mali] <laurent.navet@gmail.com>
---
 drivers/staging/line6/pcm.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c
index a0ce781..876ab89 100644
--- a/drivers/staging/line6/pcm.c
+++ b/drivers/staging/line6/pcm.c
@@ -81,7 +81,13 @@ static ssize_t pcm_set_impulse_period(struct device *dev,
 				      struct device_attribute *attr,
 				      const char *buf, size_t count)
 {
-	dev2pcm(dev)->impulse_period = simple_strtoul(buf, NULL, 10);
+        int value;
+        int rv;
+        rv = kstrtoint(buf, 10, &value);
+        if (rv < 0)
+		return rv;
+
+	dev2pcm(dev)->impulse_period = value;
 	return count;
 }
 
-- 
1.7.10.4


             reply	other threads:[~2012-11-29 20:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 20:03 Laurent Navet [Mali] [this message]
2012-11-29 20:14 ` [Line6linux-devel] [PATCH] staging: line6: use kstrtoint() instead of simple_strtoul() Stefan Hajnoczi
2012-11-29 21:52 ` Dan Carpenter

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=1354219418-6882-1-git-send-email-laurent.navet@gmail.com \
    --to=laurent.navet@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=line6linux-devel@lists.sourceforge.net \
    --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