blob: 635a95caf29f3254cfdcbc69102fb96a1faf4c51 [file] [log] [blame]
Masami Hiramatsu540adea2018-01-13 02:55:03 +09001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_ERROR_INJECTION_H
3#define _LINUX_ERROR_INJECTION_H
4
Leo Yan45880f72019-08-06 18:00:13 +08005#include <linux/compiler.h>
6#include <asm-generic/error-injection.h>
Masami Hiramatsu540adea2018-01-13 02:55:03 +09007
Leo Yan45880f72019-08-06 18:00:13 +08008#ifdef CONFIG_FUNCTION_ERROR_INJECTION
Masami Hiramatsu540adea2018-01-13 02:55:03 +09009
10extern bool within_error_injection_list(unsigned long addr);
Masami Hiramatsu663faf92018-01-13 02:55:33 +090011extern int get_injectable_error_type(unsigned long addr);
Masami Hiramatsu540adea2018-01-13 02:55:03 +090012
13#else /* !CONFIG_FUNCTION_ERROR_INJECTION */
14
Masami Hiramatsu540adea2018-01-13 02:55:03 +090015static inline bool within_error_injection_list(unsigned long addr)
16{
17 return false;
18}
19
Masami Hiramatsu663faf92018-01-13 02:55:33 +090020static inline int get_injectable_error_type(unsigned long addr)
21{
22 return EI_ETYPE_NONE;
23}
24
Masami Hiramatsu540adea2018-01-13 02:55:03 +090025#endif
26
27#endif /* _LINUX_ERROR_INJECTION_H */