Skip to content

Commit 2f96028

Browse files
committed
selftests: drivers/dma-buf: Fix implicit declaration warns
udmabuf has the following implicit declaration warns: udmabuf.c:30:10: warning: implicit declaration of function 'open'; udmabuf.c:42:8: warning: implicit declaration of function 'fcntl' These are caused due to not including fcntl.h and including just linux/fcntl.h. Fix it to include fcntl.h which will bring in the linux/fcntl.h. In addition, define __EXPORTED_HEADERS__ to bring in F_ADD_SEALS and F_SEAL_SHRINK defines and fix the following error that show up when just fcntl.h is included. udmabuf.c:45:21: error: 'F_ADD_SEALS' undeclared 45 | ret = fcntl(memfd, F_ADD_SEALS, F_SEAL_SHRINK); | ^~~~~~~~~~~ udmabuf.c:45:34: error: 'F_SEAL_SHRINK' undeclared 45 | ret = fcntl(memfd, F_ADD_SEALS, F_SEAL_SHRINK); | ^~~~~~~~~~~~~ Signed-off-by: Shuah Khan <[email protected]>
1 parent f5013d4 commit 2f96028

File tree

1 file changed

+4
-1
lines changed
  • tools/testing/selftests/drivers/dma-buf

1 file changed

+4
-1
lines changed

tools/testing/selftests/drivers/dma-buf/udmabuf.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
// SPDX-License-Identifier: GPL-2.0
2+
#define _GNU_SOURCE
3+
#define __EXPORTED_HEADERS__
4+
25
#include <stdio.h>
36
#include <stdlib.h>
47
#include <unistd.h>
58
#include <string.h>
69
#include <errno.h>
7-
#include <linux/fcntl.h>
10+
#include <fcntl.h>
811
#include <malloc.h>
912

1013
#include <sys/ioctl.h>

0 commit comments

Comments
 (0)