diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2015-05-05 18:36:29 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-08 15:26:03 +0200 |
commit | c37df5f0a0e31b1609fd931f8605f4b675d504d3 (patch) | |
tree | 27c12b9cc31feb8f212e684d922544722db37a94 /drivers/staging | |
parent | 1dbdf10471cec85f8ea036d609097552eb0ac441 (diff) |
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: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/unisys/visorbus/visorchannel.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index e555476be54d..1a1e7be6369c 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -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); |