]> Gentwo Git Trees - linux/.git/commitdiff
fbdev: xenfb: Use vmalloc_array to simplify code
authorQianfeng Rong <rongqianfeng@vivo.com>
Mon, 4 Aug 2025 07:24:11 +0000 (15:24 +0800)
committerHelge Deller <deller@gmx.de>
Tue, 30 Sep 2025 21:21:34 +0000 (23:21 +0200)
Use vmalloc_array() instead of vmalloc() to simplify the function
xenfb_probe().

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/xen-fbfront.c

index c90f48ebb15e3f32c2b06759594fc6a379317f04..d8f3bfb2dd6c9431ca0c7ec472cc82d47a9bb6de 100644 (file)
@@ -390,7 +390,7 @@ static int xenfb_probe(struct xenbus_device *dev,
 
        info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
 
-       info->gfns = vmalloc(array_size(sizeof(unsigned long), info->nr_pages));
+       info->gfns = vmalloc_array(info->nr_pages, sizeof(unsigned long));
        if (!info->gfns)
                goto error_nomem;