diff mbox series

[v2,kvmtool,01/10] linux/err.h: Add missing stdbool.h include

Message ID 20220127162033.54290-2-alexandru.elisei@arm.com (mailing list archive)
State New, archived
Headers show
Series arm64: Improve PMU support on heterogeneous systems | expand

Commit Message

Alexandru Elisei Jan. 27, 2022, 4:20 p.m. UTC
Add missing header stdbool.h to avoid errors like this one, which can
happen if the including file doesn't include stdbool.h:

include/linux/err.h:33:15: error: type defaults to ‘int’ in declaration of ‘bool’ [-Werror=implicit-int]
   33 | static inline bool __must_check IS_ERR(__force const void *ptr)
      |               ^~~~
include/linux/err.h:33:15: error: variable ‘bool’ declared ‘inline’ [-Werror]
include/linux/err.h:33:1: error: ‘warn_unused_result’ attribute only applies to function types [-Werror=attributes]
   33 | static inline bool __must_check IS_ERR(__force const void *ptr)
      | ^~~~~~
include/linux/err.h:33:33: error: expected ‘,’ or ‘;’ before ‘IS_ERR’
   33 | static inline bool __must_check IS_ERR(__force const void *ptr)
      |                                 ^~~~~~
include/linux/err.h:38:15: error: type defaults to ‘int’ in declaration of ‘bool’ [-Werror=implicit-int]
   38 | static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)
      |               ^~~~
include/linux/err.h:38:15: error: variable ‘bool’ declared ‘inline’ [-Werror]
include/linux/err.h:38:1: error: ‘warn_unused_result’ attribute only applies to function types [-Werror=attributes]
   38 | static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)
      | ^~~~~~
include/linux/err.h:38:15: error: redundant redeclaration of ‘bool’ [-Werror=redundant-decls]
   38 | static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)
      |               ^~~~
include/linux/err.h:33:15: note: previous declaration of ‘bool’ was here
   33 | static inline bool __must_check IS_ERR(__force const void *ptr)
      |               ^~~~
include/linux/err.h:38:33: error: expected ‘,’ or ‘;’ before ‘IS_ERR_OR_NULL’
   38 | static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)
      |                                 ^~~~~~~~~~~~~~
include/linux/err.h: In function ‘PTR_ERR_OR_ZERO’:
include/linux/err.h:58:6: error: implicit declaration of function ‘IS_ERR’ [-Werror=implicit-function-declaration]
   58 |  if (IS_ERR(ptr))
      |      ^~~~~~
include/linux/err.h:58:6: error: nested extern declaration of ‘IS_ERR’ [-Werror=nested-externs]

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
 include/linux/err.h | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/include/linux/err.h b/include/linux/err.h
index a729120644d5..1256c7abfefa 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -1,6 +1,8 @@ 
 #ifndef _LINUX_ERR_H
 #define _LINUX_ERR_H
 
+#include <stdbool.h>
+
 #include <linux/compiler.h>
 #include <linux/types.h>