Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Brian Gerst | af4cd3f | 2006-01-09 20:52:18 -0800 | [diff] [blame] | 2 | #ifndef _ASM_GENERIC_IOCTL_H |
| 3 | #define _ASM_GENERIC_IOCTL_H |
| 4 | |
David Howells | 8a1ab31 | 2012-10-04 18:20:15 +0100 | [diff] [blame] | 5 | #include <uapi/asm-generic/ioctl.h> |
Brian Gerst | af4cd3f | 2006-01-09 20:52:18 -0800 | [diff] [blame] | 6 | |
Hans Verkuil | d55875f | 2014-06-06 14:37:22 -0700 | [diff] [blame] | 7 | #ifdef __CHECKER__ |
| 8 | #define _IOC_TYPECHECK(t) (sizeof(t)) |
| 9 | #else |
Brian Gerst | af4cd3f | 2006-01-09 20:52:18 -0800 | [diff] [blame] | 10 | /* provoke compile error for invalid uses of size argument */ |
| 11 | extern unsigned int __invalid_size_argument_for_IOC; |
| 12 | #define _IOC_TYPECHECK(t) \ |
| 13 | ((sizeof(t) == sizeof(t[1]) && \ |
| 14 | sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ |
| 15 | sizeof(t) : __invalid_size_argument_for_IOC) |
Hans Verkuil | d55875f | 2014-06-06 14:37:22 -0700 | [diff] [blame] | 16 | #endif |
| 17 | |
Brian Gerst | af4cd3f | 2006-01-09 20:52:18 -0800 | [diff] [blame] | 18 | #endif /* _ASM_GENERIC_IOCTL_H */ |