From: Alexandru Elisei <alexandru.elisei@arm.com>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu
Cc: pbonzini@redhat.com
Subject: [kvm-unit-tests RFC PATCH v2 2/5] lib/{bitops, alloc_page}.h: Add missing headers
Date: Tue, 27 Oct 2020 17:19:41 +0000 [thread overview]
Message-ID: <20201027171944.13933-3-alexandru.elisei@arm.com> (raw)
In-Reply-To: <20201027171944.13933-1-alexandru.elisei@arm.com>
bitops.h uses the 'bool' and 'size_t' types, but doesn't include the
stddef.h and stdbool.h headers, where the types are defined. This can cause
the following error when compiling:
In file included from arm/new-test.c:9:
/path/to/kvm-unit-tests/lib/bitops.h:77:15: error: unknown type name 'bool'
77 | static inline bool is_power_of_2(unsigned long n)
| ^~~~
/path/to/kvm-unit-tests/lib/bitops.h:82:38: error: unknown type name 'size_t'
82 | static inline unsigned int get_order(size_t size)
| ^~~~~~
/path/to/kvm-unit-tests/lib/bitops.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
23 | #include <asm/bitops.h>
+++ |+#include <stddef.h>
24 |
make: *** [<builtin>: arm/new-test.o] Error 1
The same errors were observed when including alloc_page.h. Fix both files
by including stddef.h and stdbool.h.
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
lib/alloc_page.h | 2 ++
lib/bitops.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/lib/alloc_page.h b/lib/alloc_page.h
index 88540d1def06..182862c43363 100644
--- a/lib/alloc_page.h
+++ b/lib/alloc_page.h
@@ -4,6 +4,8 @@
* This is a simple allocator that provides contiguous physical addresses
* with byte granularity.
*/
+#include <stdbool.h>
+#include <stddef.h>
#ifndef ALLOC_PAGE_H
#define ALLOC_PAGE_H 1
diff --git a/lib/bitops.h b/lib/bitops.h
index 308aa86514a8..5aeea0b998b1 100644
--- a/lib/bitops.h
+++ b/lib/bitops.h
@@ -1,5 +1,7 @@
#ifndef _BITOPS_H_
#define _BITOPS_H_
+#include <stdbool.h>
+#include <stddef.h>
/*
* Adapted from
--
2.29.1
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
next prev parent reply other threads:[~2020-10-27 17:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 17:19 [kvm-unit-tests RFC PATCH v2 0/5] arm64: Statistical Profiling Extension Tests Alexandru Elisei
2020-10-27 17:19 ` [kvm-unit-tests RFC PATCH v2 1/5] arm64: Move get_id_aa64dfr0() in processor.h Alexandru Elisei
2020-10-27 17:19 ` Alexandru Elisei [this message]
2020-10-30 15:29 ` [kvm-unit-tests RFC PATCH v2 2/5] lib/{bitops, alloc_page}.h: Add missing headers Auger Eric
2020-10-30 15:58 ` Alexandru Elisei
2020-10-27 17:19 ` [kvm-unit-tests RFC PATCH v2 3/5] arm64: spe: Add introspection test Alexandru Elisei
2020-10-30 15:29 ` Auger Eric
2020-10-30 15:59 ` Alexandru Elisei
2020-10-30 17:09 ` Auger Eric
2020-10-30 17:50 ` Alexandru Elisei
2020-10-30 17:52 ` Auger Eric
2020-11-02 10:47 ` Andrew Jones
2020-10-27 17:19 ` [kvm-unit-tests RFC PATCH v2 4/5] lib: arm/arm64: Add function to unmap a page Alexandru Elisei
2020-10-30 15:46 ` Auger Eric
2020-10-30 16:00 ` Alexandru Elisei
2020-10-27 17:19 ` [kvm-unit-tests RFC PATCH v2 5/5] am64: spe: Add buffer test Alexandru Elisei
2020-10-30 17:59 ` Auger Eric
2020-10-30 16:02 ` [kvm-unit-tests RFC PATCH v2 0/5] arm64: Statistical Profiling Extension Tests Alexandru Elisei
2020-10-30 18:17 ` Auger Eric
2020-10-30 22:31 ` Alexandru Elisei
2020-11-02 12:19 ` Auger Eric
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201027171944.13933-3-alexandru.elisei@arm.com \
--to=alexandru.elisei@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).