Messages in this thread | | | Date | Thu, 25 Jul 2019 05:55:54 -0700 | From | Christoph Hellwig <> | Subject | Re: [PATCH v7 2/5] dma-buf: heaps: Add heap helpers |
| |
> +struct dma_buf *heap_helper_export_dmabuf( > + struct heap_helper_buffer *helper_buffer, > + int fd_flags)
Indentation seems odd here as it doesn't follow any of the usual schools for multi-level prototypes. But maybe shortening some identifier would help avoiding that problem altogether :)
> +static void *dma_heap_map_kernel(struct heap_helper_buffer *buffer) > +{ > + void *vaddr; > + > + vaddr = vmap(buffer->pages, buffer->pagecount, VM_MAP, PAGE_KERNEL); > + if (!vaddr) > + return ERR_PTR(-ENOMEM); > + > + return vaddr; > +}
Note that a lot of systems don't have highmem at all or don't support CMA in highmem. So for contigous allocations that aren't highmem we could skip the vmap here altogether and just use the direct mapping.
| |