You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
BACKPORT: dma-mapping: Fix build error unused-value
If CONFIG_DMA_DECLARE_COHERENT is not set,
make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- will be failed, like this:
drivers/remoteproc/remoteproc_core.c: In function ‘rproc_rvdev_release’:
./include/linux/dma-map-ops.h:182:42: error: statement with no effect [-Werror=unused-value]
#define dma_release_coherent_memory(dev) (0)
^
drivers/remoteproc/remoteproc_core.c:464:2: note: in expansion of macro ‘dma_release_coherent_memory’
dma_release_coherent_memory(dev);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
The return type of function dma_release_coherent_memory in CONFIG_DMA_DECLARE_COHERENT area is void, so in !CONFIG_DMA_DECLARE_COHERENT area it should neither return any value nor be defined as zero.
Bug: 254441685
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: e61c451476 ("dma-mapping: Add dma_release_coherent_memory to DMA API")
Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220630123528.251181-1-renzhijie2@huawei.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
(cherry picked from commit 50d6281ce9)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I2af85ae87d77721972a3c3b01288da43d8fb16bb
This commit is contained in:
committed by
Treehugger Robot
parent
c3b65245e6
commit
a7ee7101fb
@@ -191,10 +191,10 @@ static inline int dma_declare_coherent_memory(struct device *dev,
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
#define dma_release_coherent_memory(dev) (0)
|
||||
#define dma_alloc_from_dev_coherent(dev, size, handle, ret) (0)
|
||||
#define dma_release_from_dev_coherent(dev, order, vaddr) (0)
|
||||
#define dma_mmap_from_dev_coherent(dev, vma, vaddr, order, ret) (0)
|
||||
static inline void dma_release_coherent_memory(struct device *dev) { }
|
||||
|
||||
static inline void *dma_alloc_from_global_coherent(struct device *dev,
|
||||
ssize_t size, dma_addr_t *dma_handle)
|
||||
|
||||
Reference in New Issue
Block a user