netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Blaschka <blaschka@linux.vnet.ibm.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
	Thomas Richter <tmricht@linux.vnet.ibm.com>,
	Frank Blaschka <blaschka@linux.vnet.ibm.com>
Subject: [PATCH 6/6] ctcm: replace sscanf by kstrto function
Date: Wed, 22 Oct 2014 12:18:07 +0200	[thread overview]
Message-ID: <1413973087-18740-7-git-send-email-blaschka@linux.vnet.ibm.com> (raw)
In-Reply-To: <1413973087-18740-1-git-send-email-blaschka@linux.vnet.ibm.com>

From: Thomas Richter <tmricht@linux.vnet.ibm.com>

Since a single integer value is read from the supplied buffer
use the kstrto functions instead of sscanf.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
---
 drivers/s390/net/ctcm_sysfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/s390/net/ctcm_sysfs.c b/drivers/s390/net/ctcm_sysfs.c
index 6bcfbbb..47773c4 100644
--- a/drivers/s390/net/ctcm_sysfs.c
+++ b/drivers/s390/net/ctcm_sysfs.c
@@ -44,8 +44,8 @@ static ssize_t ctcm_buffer_write(struct device *dev,
 		return -ENODEV;
 	}
 
-	rc = sscanf(buf, "%u", &bs1);
-	if (rc != 1)
+	rc = kstrtouint(buf, 0, &bs1);
+	if (rc)
 		goto einval;
 	if (bs1 > CTCM_BUFSIZE_LIMIT)
 					goto einval;
@@ -151,8 +151,8 @@ static ssize_t ctcm_proto_store(struct device *dev,
 
 	if (!priv)
 		return -ENODEV;
-	rc = sscanf(buf, "%d", &value);
-	if ((rc != 1) ||
+	rc = kstrtoint(buf, 0, &value);
+	if (rc ||
 	    !((value == CTCM_PROTO_S390)  ||
 	      (value == CTCM_PROTO_LINUX) ||
 	      (value == CTCM_PROTO_MPC) ||
-- 
1.8.5.5

  parent reply	other threads:[~2014-10-22 10:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 10:18 [PATCH 0/6 resend] s390: network patches for net-next Frank Blaschka
2014-10-22 10:18 ` [PATCH 1/6] qeth: qeth_core_main make local functions static Frank Blaschka
2014-10-22 10:18 ` [PATCH 2/6] qeth: fix some trace formating issues Frank Blaschka
2014-10-22 10:18 ` [PATCH 3/6] qeth: make local functions static in qeth_l3 module Frank Blaschka
2014-10-22 10:18 ` [PATCH 4/6] qeth: s390 ethernet device driver dependency Frank Blaschka
2014-10-22 10:18 ` [PATCH 5/6] lcs: replace sscanf by kstrto function Frank Blaschka
2014-10-22 10:18 ` Frank Blaschka [this message]
2014-10-24  5:05 ` [PATCH 0/6 resend] s390: network patches for net-next David Miller

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=1413973087-18740-7-git-send-email-blaschka@linux.vnet.ibm.com \
    --to=blaschka@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tmricht@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).