Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 652d77ba authored by Thomas Richter's avatar Thomas Richter Committed by David S. Miller
Browse files

ctcm: replace sscanf by kstrto function



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

Signed-off-by: default avatarThomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: default avatarFrank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 786f0065
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -44,8 +44,8 @@ static ssize_t ctcm_buffer_write(struct device *dev,
		return -ENODEV;
		return -ENODEV;
	}
	}


	rc = sscanf(buf, "%u", &bs1);
	rc = kstrtouint(buf, 0, &bs1);
	if (rc != 1)
	if (rc)
		goto einval;
		goto einval;
	if (bs1 > CTCM_BUFSIZE_LIMIT)
	if (bs1 > CTCM_BUFSIZE_LIMIT)
					goto einval;
					goto einval;
@@ -151,8 +151,8 @@ static ssize_t ctcm_proto_store(struct device *dev,


	if (!priv)
	if (!priv)
		return -ENODEV;
		return -ENODEV;
	rc = sscanf(buf, "%d", &value);
	rc = kstrtoint(buf, 0, &value);
	if ((rc != 1) ||
	if (rc ||
	    !((value == CTCM_PROTO_S390)  ||
	    !((value == CTCM_PROTO_S390)  ||
	      (value == CTCM_PROTO_LINUX) ||
	      (value == CTCM_PROTO_LINUX) ||
	      (value == CTCM_PROTO_MPC) ||
	      (value == CTCM_PROTO_MPC) ||