[PATCH] dma-buf: fix compilation of the userspace header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jérôme Pouiller <jerome.pouiller@xxxxxxxxxx>

The typedefs u{8,16,32,64} do not exist in userspace. However, the
ioctls DMA_BUF_SET_NAME_A and DMA_BUF_SET_NAME_B use them. So,
currently, these ioctl cannot be directly called from userspace code:

ioctls_list.c:436:29: error: ‘u32’ undeclared here (not in a function)
  436 |     { DMA_BUF_SET_NAME_A, -1, -1 }, // linux/dma-buf.h
      |       ^~~~~~~~~~~~~~~~~~
ioctls_list.c:437:29: error: ‘u64’ undeclared here (not in a function)
  437 |     { DMA_BUF_SET_NAME_B, -1, -1 }, // linux/dma-buf.h
      |       ^~~~~~~~~~~~~~~~~~

Replacing u32/u64 by __u32/__u64 is sufficient to solve the problem.

Fixes: c11e391da2a8 ("dma-buf: Add ioctls to allow userspace to flush")
Signed-off-by: Jérôme Pouiller <jerome.pouiller@xxxxxxxxxx>
---
 include/uapi/linux/dma-buf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/dma-buf.h b/include/uapi/linux/dma-buf.h
index 7f30393b92c3..f76d11725c6c 100644
--- a/include/uapi/linux/dma-buf.h
+++ b/include/uapi/linux/dma-buf.h
@@ -44,7 +44,7 @@ struct dma_buf_sync {
  * between them in actual uapi, they're just different numbers.
  */
 #define DMA_BUF_SET_NAME	_IOW(DMA_BUF_BASE, 1, const char *)
-#define DMA_BUF_SET_NAME_A	_IOW(DMA_BUF_BASE, 1, u32)
-#define DMA_BUF_SET_NAME_B	_IOW(DMA_BUF_BASE, 1, u64)
+#define DMA_BUF_SET_NAME_A	_IOW(DMA_BUF_BASE, 1, __u32)
+#define DMA_BUF_SET_NAME_B	_IOW(DMA_BUF_BASE, 1, __u64)
 
 #endif
-- 
2.28.0





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux