[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250812035310.497233-4-rongqianfeng@vivo.com>
Date: Tue, 12 Aug 2025 11:53:04 +0800
From: Qianfeng Rong <rongqianfeng@...o.com>
To: Hans Verkuil <hverkuil@...nel.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-media@...r.kernel.org (open list:VIVID VIRTUAL VIDEO DRIVER),
linux-kernel@...r.kernel.org (open list)
Cc: Qianfeng Rong <rongqianfeng@...o.com>
Subject: [PATCH 3/3] media: vivid: use vmalloc_array and vcalloc to simplify code
Remove array_size() calls and replace vmalloc(array_size()) with
vmalloc_array() and vzalloc(array_size()) with vcalloc() to simplify
the code.
Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
---
drivers/media/test-drivers/vivid/vivid-core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c
index 8d56168c72aa..f712bedcf2af 100644
--- a/drivers/media/test-drivers/vivid/vivid-core.c
+++ b/drivers/media/test-drivers/vivid/vivid-core.c
@@ -1856,15 +1856,15 @@ static int vivid_create_instance(struct platform_device *pdev, int inst)
tpg_init(&dev->tpg, 640, 360);
if (tpg_alloc(&dev->tpg, array_size(MAX_WIDTH, MAX_ZOOM)))
goto free_dev;
- dev->scaled_line = vzalloc(array_size(MAX_WIDTH, MAX_ZOOM));
+ dev->scaled_line = vcalloc(MAX_WIDTH, MAX_ZOOM);
if (!dev->scaled_line)
goto free_dev;
- dev->blended_line = vzalloc(array_size(MAX_WIDTH, MAX_ZOOM));
+ dev->blended_line = vcalloc(MAX_WIDTH, MAX_ZOOM);
if (!dev->blended_line)
goto free_dev;
/* load the edid */
- dev->edid = vmalloc(array_size(256, 128));
+ dev->edid = vmalloc_array(256, 128);
if (!dev->edid)
goto free_dev;
--
2.34.1
Powered by blists - more mailing lists