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

Commit ed62f77b authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds
Browse files

cris: use simple_read_from_buffer()



Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d50004b0
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -35,19 +35,16 @@ read_cris_profile(struct file *file, char __user *buf,
		  size_t count, loff_t *ppos)
{
	unsigned long p = *ppos;
	ssize_t ret;

	if (p > SAMPLE_BUFFER_SIZE)
		return 0;

	if (p + count > SAMPLE_BUFFER_SIZE)
		count = SAMPLE_BUFFER_SIZE - p;
	if (copy_to_user(buf, sample_buffer + p,count))
		return -EFAULT;
	ret = simple_read_from_buffer(buf, count, ppos, sample_buffer,
						SAMPLE_BUFFER_SIZE);
	if (ret < 0)
		return ret;

	memset(sample_buffer + p, 0, count);
	*ppos += count;
	memset(sample_buffer + p, 0, ret);

	return count;
	return ret;
}

static ssize_t