Skip to contentSkip to conversation

dma-buf: fix compilation of the userspace header

PATCH New Jerome Pouiller 1 participant 1 message Oct 1, 2020 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma-buf: fix compilation of the userspace header

From: Jérôme Pouiller <[email protected]>

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")
---
 include/uapi/linux/dma-buf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/dma-buf.h +2 -2
index 7f30393b92c3..f76d11725c6c 100644
@@ -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
Signature · 1 line
2.28.0