aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Elisei <alexandru.elisei@arm.com>2022-04-12 14:32:21 +0100
committerWill Deacon <will@kernel.org>2022-05-06 14:21:16 +0100
commit443cd881b47126bde6f442abc1f6c76998d713b7 (patch)
tree8ad847c41477fa093dd5e6f2d27c69de659a8996
parent5657dd3e48b41bc6db38fa657994bc0e030fd31f (diff)
downloadkvmtool-443cd881b47126bde6f442abc1f6c76998d713b7.tar.gz
linux/err.h: Add missing stdbool.h include
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> Link: https://lore.kernel.org/r/20220412133231.35355-2-alexandru.elisei@arm.com Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--include/linux/err.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/err.h b/include/linux/err.h
index a7291206..1256c7ab 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>