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

Commit af6df871 authored by Peter Huewe's avatar Peter Huewe Committed by Heiko Carstens
Browse files

[S390] qdio: Use kstrtoul_from_user



This patch replaces the code for getting an unsigned long from a
userspace buffer by a simple call to kstroul_from_user.
This makes it easier to read and less error prone.

Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
Acked-by: default avatarJan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent d5f4d113
Loading
Loading
Loading
Loading
+3 −9
Original line number Original line Diff line number Diff line
@@ -188,19 +188,13 @@ static ssize_t qperf_seq_write(struct file *file, const char __user *ubuf,
	struct qdio_irq *irq_ptr = seq->private;
	struct qdio_irq *irq_ptr = seq->private;
	struct qdio_q *q;
	struct qdio_q *q;
	unsigned long val;
	unsigned long val;
	char buf[8];
	int ret, i;
	int ret, i;


	if (!irq_ptr)
	if (!irq_ptr)
		return 0;
		return 0;
	if (count >= sizeof(buf))

		return -EINVAL;
	ret = kstrtoul_from_user(ubuf, count, 10, &val);
	if (copy_from_user(&buf, ubuf, count))
	if (ret)
		return -EFAULT;
	buf[count] = 0;

	ret = strict_strtoul(buf, 10, &val);
	if (ret < 0)
		return ret;
		return ret;


	switch (val) {
	switch (val) {