History

dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace

The typedefs u32 and u64 are not available in userspace. Thus user get an error he try to use DMA_BUF_SET_NAME_A or DMA_BUF_SET_NAME_B: $ gcc -Wall -c -MMD -c -o ioctls_list.o ioctls_list.c In file included from /usr/include/x86_64-linux-gnu/asm/ioctl.h:1, from /usr/include/linux/ioctl.h:5, from /usr/include/asm-generic/ioctls.h:5, from ioctls_list.c:11: ioctls_list.c:463:29: error: ‘u32’ undeclared here (not in a function) 463 | { "DMA_BUF_SET_NAME_A", DMA_BUF_SET_NAME_A, -1, -1 }, // linux/dma-buf.h | ^~~~~~~~~~~~~~~~~~ ioctls_list.c:464:29: error: ‘u64’ undeclared here (not in a function) 464 | { "DMA_BUF_SET_NAME_B", DMA_BUF_SET_NAME_B, -1, -1 }, // linux/dma-buf.h | ^~~~~~~~~~~~~~~~~~ The issue was initially reported here[1]. [1]: https://github.com/jerome-pouiller/ioctl/pull/14

Jérôme Pouiller committed 4 years ago

Commit 7c3e9fc1 parent 370704e1 file · +2 −2Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/dma-buf.h+2−2
@@ -92,7 +92,7 @@ struct dma_buf_sync { · 91 unmodified lines
9292 * between them in actual uapi, they're just different numbers.
9393 */
9494 #define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *)
95−#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, u32)
96−#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, u64)
95+#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, __u32)
96+#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, __u64)
9797
9898 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t