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

Commit c37df5f0 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman
Browse files

staging: unisys: visorchannel_clear(): No need to use vmalloc here



Using a page is sufficient, and avoids the cost of vmalloc/vfree

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1dbdf104
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -214,17 +214,18 @@ visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch,
		   ulong nbytes)
{
	int err;
	int bufsize = 65536;
	int bufsize = PAGE_SIZE;
	int written = 0;
	u8 *buf;

	buf = vmalloc(bufsize);
	buf = (u8 *) __get_free_page(GFP_KERNEL);
	if (!buf)
		return -ENOMEM;

	memset(buf, ch, bufsize);

	while (nbytes > 0) {
		ulong thisbytes = bufsize;
		int thisbytes = bufsize;

		if (nbytes < thisbytes)
			thisbytes = nbytes;
@@ -239,7 +240,7 @@ visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch,
	err = 0;

cleanup:
	vfree(buf);
	free_page((unsigned long) buf);
	return err;
}
EXPORT_SYMBOL_GPL(visorchannel_clear);