ioctl.h 506 B

12345678910111213141516171819
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_GENERIC_IOCTL_H
  3. #define _ASM_GENERIC_IOCTL_H
  4. #include <uapi/asm-generic/ioctl.h>
  5. #ifdef __CHECKER__
  6. #define _IOC_TYPECHECK(t) (sizeof(t))
  7. #else
  8. /* provoke compile error for invalid uses of size argument */
  9. extern unsigned int __invalid_size_argument_for_IOC;
  10. #define _IOC_TYPECHECK(t) \
  11. ((sizeof(t) == sizeof(t[1]) && \
  12. sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
  13. sizeof(t) : __invalid_size_argument_for_IOC)
  14. #endif
  15. #endif /* _ASM_GENERIC_IOCTL_H */