]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: pt1: use vmalloc_array to simplify code
authorQianfeng Rong <rongqianfeng@vivo.com>
Tue, 12 Aug 2025 03:53:03 +0000 (11:53 +0800)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 14 Oct 2025 13:07:36 +0000 (15:07 +0200)
Remove array_size() calls and replace vmalloc() with vmalloc_array() to
simplify the code.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/pci/pt1/pt1.c

index 121a4a92ea1058316b42484b741594eeedadf0a6..1ced093583ac82d8f3d1261c966322b10254b4b8 100644 (file)
@@ -639,7 +639,7 @@ static int pt1_init_tables(struct pt1 *pt1)
        if (!pt1_nr_tables)
                return 0;
 
-       tables = vmalloc(array_size(pt1_nr_tables, sizeof(struct pt1_table)));
+       tables = vmalloc_array(pt1_nr_tables, sizeof(struct pt1_table));
        if (tables == NULL)
                return -ENOMEM;