Use vmalloc_array() instead of vmalloc() to simplify the functions
nv84_fence_suspend().

vmalloc_array() is also optimized better, resulting in less instructions
being used.

Signed-off-by: Qianfeng Rong <[email protected]>
---
 drivers/gpu/drm/nouveau/nv84_fence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nv84_fence.c 
b/drivers/gpu/drm/nouveau/nv84_fence.c
index 1765b2cedaf9..63a477e631ae 100644
--- a/drivers/gpu/drm/nouveau/nv84_fence.c
+++ b/drivers/gpu/drm/nouveau/nv84_fence.c
@@ -158,7 +158,7 @@ nv84_fence_suspend(struct nouveau_drm *drm)
        struct nv84_fence_priv *priv = drm->fence;
        int i;
 
-       priv->suspend = vmalloc(array_size(sizeof(u32), drm->chan_total));
+       priv->suspend = vmalloc_array(drm->chan_total, sizeof(u32));
        if (priv->suspend) {
                for (i = 0; i < drm->chan_total; i++)
                        priv->suspend[i] = nouveau_bo_rd32(priv->bo, i*4);
-- 
2.34.1

Reply via email to