]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: drivers/dma-buf: Fix implicit declaration warns
authorShuah Khan <skhan@linuxfoundation.org>
Fri, 17 Sep 2021 23:58:13 +0000 (17:58 -0600)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 27 Sep 2021 15:52:29 +0000 (09:52 -0600)
commit6019e71827795812090c4015a28e78e1735e9331
treedcf565011dba31f45db90492342607d0dc742382
parent8a0c77176da675b5fd5d03bb4ef94842b2c81340
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 <skhan@linuxfoundation.org>
tools/testing/selftests/drivers/dma-buf/udmabuf.c