lkml.org 
[lkml]   [2019]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] firmware: qcom_scm: fix error for incompatible pointer
On Mon, Jul 22, 2019 at 10:38:55AM +0200, Marc Gonzalez wrote:
> > In file included from drivers/firmware/qcom_scm.c:12:0:
> > ./include/linux/dma-mapping.h:636:21: note: expected ‘dma_addr_t * {aka long long unsigned int *}’ but argument is of type ‘phys_addr_t * {aka unsigned int *}’
> > static inline void *dma_alloc_coherent(struct device *dev, size_t size,
> > ^~~~~~~~~~~~~~~~~~
> > ```
> >
> > We just can cast phys_addr_t to dma_addr_t here.
>
> IME, casting is rarely a proper solution.

*nod*

ptr_phys probably should be a dma_addr_t. Unless this driver is so
magic that it really wants a physical and not a dma address, in which
case it needs to use alloc_pages instead of dma_alloc_coherent
and then call page_to_phys on the returned page, and a very big comment
explaining why it is so special.

\
 
 \ /
  Last update: 2019-07-22 11:31    [W:0.068 / U:4.840 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site