From: Victor Lira <victorm.lira@amd.com>
The missing include prevents it from compiling when CONFIG_COVERAGE is not set
and the header is included in a file that has not already included errno.h,
causing EOPNOTSUPP to be undeclared.
Add the missing include.
Signed-off-by: Victor Lira <victorm.lira@amd.com>
---
example of the problem:
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 7ad870e382c..4d27f16e8ef 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -10,6 +10,7 @@
#include <xen/bootinfo.h>
#include <xen/compile.h>
+#include <xen/coverage.h>
#include <xen/device_tree.h>
#include <xen/dom0less-build.h>
#include <xen/domain_page.h>
---
In file included from arch/arm/setup.c:13:
./include/xen/coverage.h: In function 'sysctl_cov_op':
./include/xen/coverage.h:10:13: error: 'EOPNOTSUPP' undeclared (first use in this function)
10 | return -EOPNOTSUPP;
---
xen/include/xen/coverage.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/xen/include/xen/coverage.h b/xen/include/xen/coverage.h
index ba5fb67947..28506c239b 100644
--- a/xen/include/xen/coverage.h
+++ b/xen/include/xen/coverage.h
@@ -5,6 +5,7 @@
#include <public/sysctl.h>
int sysctl_cov_op(struct xen_sysctl_coverage_op *op);
#else
+#include <xen/errno.h>
static inline int sysctl_cov_op(void *unused)
{
return -EOPNOTSUPP;
--
2.50.GIT
On 11/09/2025 12:40 am, victorm.lira@amd.com wrote: > From: Victor Lira <victorm.lira@amd.com> > > The missing include prevents it from compiling when CONFIG_COVERAGE is not set > and the header is included in a file that has not already included errno.h, > causing EOPNOTSUPP to be undeclared. > > Add the missing include. > > Signed-off-by: Victor Lira <victorm.lira@amd.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>, although > --- > example of the problem: > diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c > index 7ad870e382c..4d27f16e8ef 100644 > --- a/xen/arch/arm/setup.c > +++ b/xen/arch/arm/setup.c > @@ -10,6 +10,7 @@ > > #include <xen/bootinfo.h> > #include <xen/compile.h> > +#include <xen/coverage.h> > #include <xen/device_tree.h> > #include <xen/dom0less-build.h> > #include <xen/domain_page.h> > --- > > In file included from arch/arm/setup.c:13: > ./include/xen/coverage.h: In function 'sysctl_cov_op': > ./include/xen/coverage.h:10:13: error: 'EOPNOTSUPP' undeclared (first use in this function) > 10 | return -EOPNOTSUPP; > --- > xen/include/xen/coverage.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/xen/include/xen/coverage.h b/xen/include/xen/coverage.h > index ba5fb67947..28506c239b 100644 > --- a/xen/include/xen/coverage.h > +++ b/xen/include/xen/coverage.h > @@ -5,6 +5,7 @@ > #include <public/sysctl.h> > int sysctl_cov_op(struct xen_sysctl_coverage_op *op); > #else > +#include <xen/errno.h> > static inline int sysctl_cov_op(void *unused) > { > return -EOPNOTSUPP; ... this is starting to get overly busy to read and could do with some extra lines around the primary #ifdef CONFIG_COVERAGE / #else / #endif. Happy to fix up on commit. ~Andrew
On 9/10/2025 4:47 PM, Andrew Cooper wrote: > @@ -5,6 +5,7 @@ > #include <public/sysctl.h> > int sysctl_cov_op(struct xen_sysctl_coverage_op *op); > #else > +#include <xen/errno.h> > static inline int sysctl_cov_op(void *unused) > { > return -EOPNOTSUPP; > ... this is starting to get overly busy to read and could do with some > extra lines around the primary #ifdef CONFIG_COVERAGE / #else / #endif. > > Happy to fix up on commit. OK, its fine by me. Victor
© 2016 - 2025 Red Hat, Inc.