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

Commit 4ea2f43f authored by Wu Fengguang's avatar Wu Fengguang Committed by Linus Torvalds
Browse files

/dev/mem: remove redundant test on len



The len test in write_kmem() is always true, so can be reduced.

Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Avi Kivity <avi@qumranet.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 659ace58
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -581,7 +581,6 @@ static ssize_t write_kmem(struct file * file, const char __user * buf,

			if (len > PAGE_SIZE)
				len = PAGE_SIZE;
			if (len) {
			written = copy_from_user(kbuf, buf, len);
			if (written) {
				if (wrote + virtr)
@@ -589,7 +588,6 @@ static ssize_t write_kmem(struct file * file, const char __user * buf,
				free_page((unsigned long)kbuf);
				return -EFAULT;
			}
			}
			len = vwrite(kbuf, (char *)p, len);
			count -= len;
			buf += len;