diff mbox series

dma-buf: fix compilation of the userspace header

Message ID 20201001082138.381495-1-Jerome.Pouiller@silabs.com
State New
Headers show
Series dma-buf: fix compilation of the userspace header | expand

Commit Message

Jérôme Pouiller Oct. 1, 2020, 8:21 a.m. UTC
From: Jérôme Pouiller <jerome.pouiller@silabs.com>

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@silabs.com>
---
 include/uapi/linux/dma-buf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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