Skip to contentSkip to conversation

dma-buf: Fix a warning message in dma_heap_buffer_destroy()

PATCH In review Dan Carpenter 2 participants 2 messages Oct 29, 2019 – Oct 30, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma-buf: Fix a warning message in dma_heap_buffer_destroy()

The first argument of WARN() is a condition so this will just print the function name instead of the whole warning message.

Fixes 7b87ea704fd9 ("dma-buf: heaps: Add heap helpers")
---
 drivers/dma-buf/heaps/heap-helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma-buf/heaps/heap-helpers.c +1 -1
index 750bef4e902d..a31684c0d5b2 100644
@@ -52,7 +52,7 @@ static void *dma_heap_map_kernel(struct heap_helper_buffer *buffer)
 static void dma_heap_buffer_destroy(struct heap_helper_buffer *buffer)
 {
 	if (buffer->vmap_cnt > 0) {
-		WARN("%s: buffer still mapped in the kernel\n", __func__);
+		WARN(1, "%s: buffer still mapped in the kernel\n", __func__);
 		vunmap(buffer->vaddr);
 	}
 
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · Dan Carpenter

The first argument of WARN() is a condition so this will just print the function name instead of the whole warning message.

Fixes 7b87ea704fd9 ("dma-buf: heaps: Add heap helpers")
---
 drivers/dma-buf/heaps/heap-helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma-buf/heaps/heap-helpers.c +0 -0
index 750bef4e902d..a31684c0d5b2 100644

drivers/dma-buf/heaps/heap-helpers.c static void *dma_heap_map_kernel(struct heap_helper_buffer *buffer) · line 57

Quoted 7 lines
drivers/dma-buf/heaps/heap-helpers.c +1 -1
@@ -52,7 +52,7 @@ static void *dma_heap_map_kernel(struct heap_helper_buffer *buffer)
 static void dma_heap_buffer_destroy(struct heap_helper_buffer *buffer)
 {
        if (buffer->vmap_cnt > 0) {
-               WARN("%s: buffer still mapped in the kernel\n", __func__);
+               WARN(1, "%s: buffer still mapped in the kernel\n", __func__);
                vunmap(buffer->vaddr);
        }

Thanks for catching and reporting this!

Sumit, do you mind picking this up for drm-misc-next?

thanks
-john