[lkml]   [2019]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] error-injection: Include definitions for bool and true/false
If error injection user hasn't included definitions for bool and
true/false, kernel may not compile under certain case, just like:

All errors (new ones prefixed by >>):

In file included from fs//btrfs/tree-checker.c:18:
>> include/linux/error-injection.h:15:15: error: unknown type name 'bool'
static inline bool within_error_injection_list(unsigned long addr)
include/linux/error-injection.h: In function 'within_error_injection_list':
>> include/linux/error-injection.h:17:9: error: 'false' undeclared (first use in this function)
return false;
include/linux/error-injection.h:17:9: note: each undeclared identifier is reported only once for each function it appears in

Anyway the fix is straightforward, include <linux/types.h> for bool and
<linux/stddef.h> for true/false in error-injection.h to make it self

Reported-by: kbuild test robot <>
Signed-off-by: Qu Wenruo <>
include/linux/error-injection.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/linux/error-injection.h b/include/linux/error-injection.h
index 280c61ecbf20..1a8e09978616 100644
--- a/include/linux/error-injection.h
+++ b/include/linux/error-injection.h
@@ -2,6 +2,8 @@

+#include <linux/types.h> /* for bool */
+#include <linux/stddef.h> /* for true/false */

#include <asm/error-injection.h>
 \ /
  Last update: 2019-04-25 16:34    [W:0.029 / U:8.640 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site