Skip to content

Commit

Permalink
checkpolicy: drop union stack_item_u
Browse files Browse the repository at this point in the history
The union stack_item_u is only used as a member in struct scope_stack,
but actually never used.

Signed-off-by: Christian Göttsche <[email protected]>
Acked-by: James Carter <[email protected]>
  • Loading branch information
cgzones authored and jwcart2 committed Apr 4, 2024
1 parent 08e55df commit 04303b5
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions checkpolicy/module_compiler.c
Expand Up @@ -21,14 +21,8 @@
#include "queue.h"
#include "module_compiler.h"

union stack_item_u {
avrule_block_t *avrule;
cond_list_t *cond_list;
};

typedef struct scope_stack {
union stack_item_u u;
int type; /* for above union: 1 = avrule block, 2 = conditional */
int type; /* 1 = avrule block, 2 = conditional */
avrule_decl_t *decl; /* if in an avrule block, which
* declaration is current */
avrule_t *last_avrule;
Expand Down Expand Up @@ -1464,12 +1458,12 @@ static int push_stack(int stack_type, ...)
va_start(ap, stack_type);
switch (s->type = stack_type) {
case 1:{
s->u.avrule = va_arg(ap, avrule_block_t *);
va_arg(ap, avrule_block_t *);
s->decl = va_arg(ap, avrule_decl_t *);
break;
}
case 2:{
s->u.cond_list = va_arg(ap, cond_list_t *);
va_arg(ap, cond_list_t *);
break;
}
default:
Expand Down

0 comments on commit 04303b5

Please sign in to comment.