drm/nouveau/ttm: constify static vm_operations_struct
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Tue, 9 Feb 2021 23:48:17 +0000 (00:48 +0100)
committerChristian König <christian.koenig@amd.com>
Thu, 25 Feb 2021 13:40:25 +0000 (14:40 +0100)
The only usage of nouveau_ttm_vm_ops is to assign its address to the
vm_ops field in the vm_area_struct struct. Make it const to allow the
compiler to put it in read-only memory

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210209234817.55112-4-rikard.falkeborn@gmail.com
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/nouveau/nouveau_ttm.c

index 4952881..b81ae90 100644 (file)
@@ -154,7 +154,7 @@ error_unlock:
        return ret;
 }
 
-static struct vm_operations_struct nouveau_ttm_vm_ops = {
+static const struct vm_operations_struct nouveau_ttm_vm_ops = {
        .fault = nouveau_ttm_fault,
        .open = ttm_bo_vm_open,
        .close = ttm_bo_vm_close,