error-injection.h 607 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_ERROR_INJECTION_H
  3. #define _LINUX_ERROR_INJECTION_H
  4. #include <linux/compiler.h>
  5. #include <asm-generic/error-injection.h>
  6. #ifdef CONFIG_FUNCTION_ERROR_INJECTION
  7. extern bool within_error_injection_list(unsigned long addr);
  8. extern int get_injectable_error_type(unsigned long addr);
  9. #else /* !CONFIG_FUNCTION_ERROR_INJECTION */
  10. static inline bool within_error_injection_list(unsigned long addr)
  11. {
  12. return false;
  13. }
  14. static inline int get_injectable_error_type(unsigned long addr)
  15. {
  16. return EI_ETYPE_NONE;
  17. }
  18. #endif
  19. #endif /* _LINUX_ERROR_INJECTION_H */