mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-26 08:49:02 +00:00
Fix compilation failure caused by DMA heaps (#2292)
Project fails to build on systems with a kernel version older than 5.6.0 because of `-Wunused-function` combined with `-Werror`. Expand the conditional compilation guard to include the offending code.
This commit is contained in:
@@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
||||||
#include <linux/dma-heap.h>
|
#include <linux/dma-heap.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
struct dma_buf_heap_helper_t
|
struct dma_buf_heap_helper_t
|
||||||
{
|
{
|
||||||
@@ -64,6 +63,7 @@ static dma_buf_heap_helper_t lookup_dma_heap(dma_buf_heap_type heap_type)
|
|||||||
&& "DMA heap type does not have an entry in DMA_BUF_HEAP_TABLE");
|
&& "DMA heap type does not have an entry in DMA_BUF_HEAP_TABLE");
|
||||||
return DMA_BUF_HEAP_TABLE[0];
|
return DMA_BUF_HEAP_TABLE[0];
|
||||||
}
|
}
|
||||||
|
#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
||||||
|
|
||||||
int allocate_dma_buf(uint64_t size, dma_buf_heap_type heap_type)
|
int allocate_dma_buf(uint64_t size, dma_buf_heap_type heap_type)
|
||||||
{
|
{
|
||||||
@@ -106,8 +106,6 @@ int allocate_dma_buf(uint64_t size, dma_buf_heap_type heap_type)
|
|||||||
|
|
||||||
return dma_heap_data.fd;
|
return dma_heap_data.fd;
|
||||||
#else
|
#else
|
||||||
#warning \
|
|
||||||
"Kernel version doesn't support DMA buffer heaps (at least v5.6.0 is required)."
|
|
||||||
return TEST_SKIPPED_ITSELF;
|
return TEST_SKIPPED_ITSELF;
|
||||||
#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user