Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dma-buf/heaps: Correct the types of fd_flags and heap_flags

dma_heap_allocation_data defines the UAPI as follows:

struct dma_heap_allocation_data {
__u64 len;
__u32 fd;
__u32 fd_flags;
__u64 heap_flags;
};

But dma heaps are casting both fd_flags and heap_flags into
unsigned long. This patch makes dma heaps - cma heap and
system heap have consistent types with UAPI.

Signed-off-by: Barry Song <v-songbaohua@oppo.com>
Acked-by: John Stultz <jstultz@google.com>
Reviewed-by: Carlos Llamas <cmllamas@google.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240606020213.49854-1-21cnbao@gmail.com

authored by

Barry Song and committed by
Sumit Semwal
b9578c49 72533b67

+6 -6
+2 -2
drivers/dma-buf/heaps/cma_heap.c
··· 274 274 275 275 static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, 276 276 unsigned long len, 277 - unsigned long fd_flags, 278 - unsigned long heap_flags) 277 + u32 fd_flags, 278 + u64 heap_flags) 279 279 { 280 280 struct cma_heap *cma_heap = dma_heap_get_drvdata(heap); 281 281 struct cma_heap_buffer *buffer;
+2 -2
drivers/dma-buf/heaps/system_heap.c
··· 333 333 334 334 static struct dma_buf *system_heap_allocate(struct dma_heap *heap, 335 335 unsigned long len, 336 - unsigned long fd_flags, 337 - unsigned long heap_flags) 336 + u32 fd_flags, 337 + u64 heap_flags) 338 338 { 339 339 struct system_heap_buffer *buffer; 340 340 DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
+2 -2
include/linux/dma-heap.h
··· 23 23 struct dma_heap_ops { 24 24 struct dma_buf *(*allocate)(struct dma_heap *heap, 25 25 unsigned long len, 26 - unsigned long fd_flags, 27 - unsigned long heap_flags); 26 + u32 fd_flags, 27 + u64 heap_flags); 28 28 }; 29 29 30 30 /**