]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dma-buf: heaps: system: Remove global variable
authorMaxime Ripard <mripard@kernel.org>
Mon, 7 Apr 2025 16:29:07 +0000 (18:29 +0200)
committerChristian König <christian.koenig@amd.com>
Tue, 8 Apr 2025 09:48:39 +0000 (11:48 +0200)
The system heap is storing its struct dma_heap pointer in a global
variable but isn't using it anywhere.

Let's move the global variable into system_heap_create() to make it
local.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250407-dma-buf-ecc-heap-v3-1-97cdd36a5f29@kernel.org
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/dma-buf/heaps/system_heap.c

index 26d5dc89ea1663a0d078e3a5723ca3d8d12b935f..82b1b714300d6ff5f3e543059dd8215ceaa00c69 100644 (file)
@@ -21,8 +21,6 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 
-static struct dma_heap *sys_heap;
-
 struct system_heap_buffer {
        struct dma_heap *heap;
        struct list_head attachments;
@@ -424,6 +422,7 @@ static const struct dma_heap_ops system_heap_ops = {
 static int __init system_heap_create(void)
 {
        struct dma_heap_export_info exp_info;
+       struct dma_heap *sys_heap;
 
        exp_info.name = "system";
        exp_info.ops = &system_heap_ops;