diff mbox series

[1/3] libsepol: break circular include

Message ID 20220713134343.19811-1-cgzones@googlemail.com (mailing list archive)
State Accepted
Commit 12beafe7ce51
Headers show
Series [1/3] libsepol: break circular include | expand

Commit Message

Christian Göttsche July 13, 2022, 1:43 p.m. UTC
Since `struct type_set` is forward declared including
policydb/policydb.h is not necessary and creates a circular include.

Also drop the unnecessary forward declaration of `struct policydb`.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libsepol/include/sepol/policydb/constraint.h | 3 ---
 1 file changed, 3 deletions(-)

Comments

James Carter July 19, 2022, 4:29 p.m. UTC | #1
On Wed, Jul 13, 2022 at 9:50 AM Christian Göttsche
<cgzones@googlemail.com> wrote:
>
> Since `struct type_set` is forward declared including
> policydb/policydb.h is not necessary and creates a circular include.
>
> Also drop the unnecessary forward declaration of `struct policydb`.
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>

For these three patches:
Acked-by: James Carter <jwcart2@gmail.com>

> ---
>  libsepol/include/sepol/policydb/constraint.h | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/libsepol/include/sepol/policydb/constraint.h b/libsepol/include/sepol/policydb/constraint.h
> index b91fc4e9..82335e21 100644
> --- a/libsepol/include/sepol/policydb/constraint.h
> +++ b/libsepol/include/sepol/policydb/constraint.h
> @@ -18,7 +18,6 @@
>  #ifndef _SEPOL_POLICYDB_CONSTRAINT_H_
>  #define _SEPOL_POLICYDB_CONSTRAINT_H_
>
> -#include <sepol/policydb/policydb.h>
>  #include <sepol/policydb/ebitmap.h>
>  #include <sepol/policydb/flask_types.h>
>
> @@ -70,8 +69,6 @@ typedef struct constraint_node {
>         struct constraint_node *next;   /* next constraint */
>  } constraint_node_t;
>
> -struct policydb;
> -
>  extern int constraint_expr_init(constraint_expr_t * expr);
>  extern void constraint_expr_destroy(constraint_expr_t * expr);
>
> --
> 2.36.1
>
James Carter Aug. 9, 2022, 3:18 p.m. UTC | #2
On Tue, Jul 19, 2022 at 12:29 PM James Carter <jwcart2@gmail.com> wrote:
>
> On Wed, Jul 13, 2022 at 9:50 AM Christian Göttsche
> <cgzones@googlemail.com> wrote:
> >
> > Since `struct type_set` is forward declared including
> > policydb/policydb.h is not necessary and creates a circular include.
> >
> > Also drop the unnecessary forward declaration of `struct policydb`.
> >
> > Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>
> For these three patches:
> Acked-by: James Carter <jwcart2@gmail.com>
>

These three patches have been merged.
Thanks,
Jim

> > ---
> >  libsepol/include/sepol/policydb/constraint.h | 3 ---
> >  1 file changed, 3 deletions(-)
> >
> > diff --git a/libsepol/include/sepol/policydb/constraint.h b/libsepol/include/sepol/policydb/constraint.h
> > index b91fc4e9..82335e21 100644
> > --- a/libsepol/include/sepol/policydb/constraint.h
> > +++ b/libsepol/include/sepol/policydb/constraint.h
> > @@ -18,7 +18,6 @@
> >  #ifndef _SEPOL_POLICYDB_CONSTRAINT_H_
> >  #define _SEPOL_POLICYDB_CONSTRAINT_H_
> >
> > -#include <sepol/policydb/policydb.h>
> >  #include <sepol/policydb/ebitmap.h>
> >  #include <sepol/policydb/flask_types.h>
> >
> > @@ -70,8 +69,6 @@ typedef struct constraint_node {
> >         struct constraint_node *next;   /* next constraint */
> >  } constraint_node_t;
> >
> > -struct policydb;
> > -
> >  extern int constraint_expr_init(constraint_expr_t * expr);
> >  extern void constraint_expr_destroy(constraint_expr_t * expr);
> >
> > --
> > 2.36.1
> >
diff mbox series

Patch

diff --git a/libsepol/include/sepol/policydb/constraint.h b/libsepol/include/sepol/policydb/constraint.h
index b91fc4e9..82335e21 100644
--- a/libsepol/include/sepol/policydb/constraint.h
+++ b/libsepol/include/sepol/policydb/constraint.h
@@ -18,7 +18,6 @@ 
 #ifndef _SEPOL_POLICYDB_CONSTRAINT_H_
 #define _SEPOL_POLICYDB_CONSTRAINT_H_
 
-#include <sepol/policydb/policydb.h>
 #include <sepol/policydb/ebitmap.h>
 #include <sepol/policydb/flask_types.h>
 
@@ -70,8 +69,6 @@  typedef struct constraint_node {
 	struct constraint_node *next;	/* next constraint */
 } constraint_node_t;
 
-struct policydb;
-
 extern int constraint_expr_init(constraint_expr_t * expr);
 extern void constraint_expr_destroy(constraint_expr_t * expr);