Merge tag 'mm-hotfixes-stable-2023-05-03-16-27' of git://git.kernel.org/pub/scm/linux...
[linux-block.git] / include / linux / error-injection.h
CommitLineData
540adea3
MH
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_ERROR_INJECTION_H
3#define _LINUX_ERROR_INJECTION_H
4
45880f7b 5#include <linux/compiler.h>
6338bb05 6#include <linux/errno.h>
45880f7b 7#include <asm-generic/error-injection.h>
540adea3 8
45880f7b 9#ifdef CONFIG_FUNCTION_ERROR_INJECTION
540adea3
MH
10
11extern bool within_error_injection_list(unsigned long addr);
663faf9f 12extern int get_injectable_error_type(unsigned long addr);
540adea3
MH
13
14#else /* !CONFIG_FUNCTION_ERROR_INJECTION */
15
540adea3
MH
16static inline bool within_error_injection_list(unsigned long addr)
17{
18 return false;
19}
20
663faf9f
MH
21static inline int get_injectable_error_type(unsigned long addr)
22{
6338bb05 23 return -EOPNOTSUPP;
663faf9f
MH
24}
25
540adea3
MH
26#endif
27
28#endif /* _LINUX_ERROR_INJECTION_H */