diff mbox

fbdev: auo_k190x: Use zeroing memory allocator than allocator/memset

Message ID 1514723157-5675-1-git-send-email-himanshujha199640@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Himanshu Jha Dec. 31, 2017, 12:25 p.m. UTC
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>
---
 drivers/video/fbdev/auo_k190x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Bartlomiej Zolnierkiewicz Jan. 4, 2018, 3:50 p.m. UTC | #1
On Sunday, December 31, 2017 05:55:57 PM Himanshu Jha wrote:
> Use vzalloc for allocating zeroed memory and remove unnecessary
> memset function.
> 
> Done using Coccinelle.
> Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci

Use of "Generated-by:" triggers checkpatch.pl warning + error:

WARNING: Non-standard signature: Generated-by:
#8: 
Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci

ERROR: Unrecognized email address: 'scripts/coccinelle/api/alloc/kzalloc-simple.cocci'
#8: 
Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci

I've changed it to "Generate-by" to silence checkpatch.pl.

> 0-day tested with no failures.
> 
> Suggested-by: Luis R. Rodriguez <mcgrof@kernel.org>
> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>

Patch queued for 4.16, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/video/fbdev/auo_k190x.c b/drivers/video/fbdev/auo_k190x.c
index 0d060383..b889401 100644
--- a/drivers/video/fbdev/auo_k190x.c
+++ b/drivers/video/fbdev/auo_k190x.c
@@ -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;