[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251021143122.268730-3-tanze@kylinos.cn>
Date: Tue, 21 Oct 2025 22:31:21 +0800
From: tanze <tanze@...inos.cn>
To: mchehab@...nel.org,
mingo@...nel.org,
hverkuil@...nel.org,
tskd08@...il.com
Cc: linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org,
tanze <tanze@...inos.cn>
Subject: [PATCH 2/3] media: vivid: Optimize the code using vmalloc_array
Change array_size() to vmalloc_array(), Due to vmalloc_array() is optimized better,
uses fewer instructions, and handles overflow more concisely
Signed-off-by: tanze <tanze@...inos.cn>
---
drivers/media/test-drivers/vivid/vivid-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c
index 86506be36acb..d9dac574af8b 100644
--- a/drivers/media/test-drivers/vivid/vivid-core.c
+++ b/drivers/media/test-drivers/vivid/vivid-core.c
@@ -1864,7 +1864,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst)
goto free_dev;
/* load the edid */
- dev->edid = vmalloc(array_size(256, 128));
+ dev->edid = vmalloc_array(128, 256);
if (!dev->edid)
goto free_dev;
--
2.25.1
Powered by blists - more mailing lists