Skip to content

Commit

Permalink
fbdev: auo_k190x: Use zeroing memory allocator instead of allocator/m…
Browse files Browse the repository at this point in the history
…emset

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>
  • Loading branch information
Himanshu Jha authored and Bartlomiej Zolnierkiewicz committed Jan 4, 2018
1 parent 7b9faf5 commit f950bc7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/video/fbdev/auo_k190x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f950bc7

Please sign in to comment.