18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _ASM_GENERIC_IOCTL_H
38c2ecf20Sopenharmony_ci#define _ASM_GENERIC_IOCTL_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <uapi/asm-generic/ioctl.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#ifdef __CHECKER__
88c2ecf20Sopenharmony_ci#define _IOC_TYPECHECK(t) (sizeof(t))
98c2ecf20Sopenharmony_ci#else
108c2ecf20Sopenharmony_ci/* provoke compile error for invalid uses of size argument */
118c2ecf20Sopenharmony_ciextern unsigned int __invalid_size_argument_for_IOC;
128c2ecf20Sopenharmony_ci#define _IOC_TYPECHECK(t) \
138c2ecf20Sopenharmony_ci	((sizeof(t) == sizeof(t[1]) && \
148c2ecf20Sopenharmony_ci	  sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
158c2ecf20Sopenharmony_ci	  sizeof(t) : __invalid_size_argument_for_IOC)
168c2ecf20Sopenharmony_ci#endif
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#endif /* _ASM_GENERIC_IOCTL_H */
19