diff mbox series

[for-next,4/6] xen: Fix build when !CONFIG_GRANT_TABLE

Message ID eb2d1e911870f1662acfbc073447af2d29455750.1614265718.git.connojdavis@gmail.com (mailing list archive)
State New
Headers show
Series Minimal build for RISCV | expand

Commit Message

Connor Davis Feb. 25, 2021, 3:24 p.m. UTC
Declare struct grant_table {}; in grant_table.h when
!CONFIG_GRANT_TABLE. This fixes the following:

/build/xen/include/xen/grant_table.h:84:50: error: 'struct grant_table'
declared inside parameter list will not be visible outside of this
definition or declaration [-Werror]
   84 | static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
      |

Signed-off-by: Connor Davis <connojdavis@gmail.com>
---
 xen/include/xen/grant_table.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jan Beulich Feb. 25, 2021, 3:53 p.m. UTC | #1
On 25.02.2021 16:24, Connor Davis wrote:
> --- a/xen/include/xen/grant_table.h
> +++ b/xen/include/xen/grant_table.h
> @@ -66,6 +66,8 @@ int gnttab_acquire_resource(
>  
>  #define opt_max_grant_frames 0
>  
> +struct grant_table {};
> +
>  static inline int grant_table_init(struct domain *d,
>                                     int max_grant_frames,
>                                     int max_maptrack_frames)

You shouldn't actually declare a struct, all you need is to
move the forward decl further up in the file ahead of the
#ifdef.

Jan
Connor Davis Feb. 26, 2021, 3:36 a.m. UTC | #2
On Thu, Feb 25, 2021 at 04:53:23PM +0100, Jan Beulich wrote:
> On 25.02.2021 16:24, Connor Davis wrote:
> > --- a/xen/include/xen/grant_table.h
> > +++ b/xen/include/xen/grant_table.h
> > @@ -66,6 +66,8 @@ int gnttab_acquire_resource(
> >  
> >  #define opt_max_grant_frames 0
> >  
> > +struct grant_table {};
> > +
> >  static inline int grant_table_init(struct domain *d,
> >                                     int max_grant_frames,
> >                                     int max_maptrack_frames)
> 
> You shouldn't actually declare a struct, all you need is to
> move the forward decl further up in the file ahead of the
> #ifdef.

Thanks, will fix this in v2.

    Connor
diff mbox series

Patch

diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 63b6dc78f4..0e5f6f85c7 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -66,6 +66,8 @@  int gnttab_acquire_resource(
 
 #define opt_max_grant_frames 0
 
+struct grant_table {};
+
 static inline int grant_table_init(struct domain *d,
                                    int max_grant_frames,
                                    int max_maptrack_frames)