fbdev: auo_k190x: Use zeroing memory allocator instead of allocator/memset
authorHimanshu Jha <himanshujha199640@gmail.com>
Thu, 4 Jan 2018 15:53:50 +0000 (16:53 +0100)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Thu, 4 Jan 2018 15:53:50 +0000 (16:53 +0100)
Use vzalloc for allocating zeroed memory and remove unnecessary
memset function.

Done using Coccinelle.
Generated-by scripts/coccinelle/api/alloc/kzalloc-simple.cocci.
0-day tested with no failures.

Suggested-by: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
[b.zolnierkie: fixed minor issues in the patch description]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/auo_k190x.c

index 0d06038324e003d07ca3bd4e1d4c16d16f03303b..b8894013014bf86d3d5986b0576bccca3d7da457 100644 (file)
@@ -1056,13 +1056,12 @@ int auok190x_common_probe(struct platform_device *pdev,
        /* videomemory handling */
 
        videomemorysize = roundup((panel->w * panel->h) * 2, PAGE_SIZE);
-       videomemory = vmalloc(videomemorysize);
+       videomemory = vzalloc(videomemorysize);
        if (!videomemory) {
                ret = -ENOMEM;
                goto err_irq;
        }
 
-       memset(videomemory, 0, videomemorysize);
        info->screen_base = (char *)videomemory;
        info->fix.smem_len = videomemorysize;