diff mbox

[2/2] libsepol: do not mark db as unused when it is used

Message ID 20170531200615.9166-2-nicolas.iooss@m4x.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Nicolas Iooss May 31, 2017, 8:06 p.m. UTC
---
 libsepol/cil/src/cil_build_ast.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

James Carter June 1, 2017, 4:36 p.m. UTC | #1
On 05/31/2017 04:06 PM, Nicolas Iooss wrote:
> ---
>   libsepol/cil/src/cil_build_ast.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
> index 0a9a5e57491a..7fcee61042c5 100644
> --- a/libsepol/cil/src/cil_build_ast.c
> +++ b/libsepol/cil/src/cil_build_ast.c
> @@ -4256,7 +4256,7 @@ void cil_destroy_filecon(struct cil_filecon *filecon)
>   	free(filecon);
>   }
>   
> -int cil_gen_ibpkeycon(__attribute__((unused)) struct cil_db *db, struct cil_tree_node *parse_current, struct cil_tree_node *ast_node)
> +int cil_gen_ibpkeycon(struct cil_db *db, struct cil_tree_node *parse_current, struct cil_tree_node *ast_node)
>   {
>   	enum cil_syntax syntax[] = {
>   		CIL_SYN_STRING,
> @@ -4667,7 +4667,7 @@ void cil_destroy_netifcon(struct cil_netifcon *netifcon)
>   	free(netifcon);
>   }
>   
> -int cil_gen_ibendportcon(__attribute__((unused)) struct cil_db *db, struct cil_tree_node *parse_current, struct cil_tree_node *ast_node)
> +int cil_gen_ibendportcon(struct cil_db *db, struct cil_tree_node *parse_current, struct cil_tree_node *ast_node)
>   {
>   	enum cil_syntax syntax[] = {
>   		CIL_SYN_STRING,
> 

In both cases, the only use of db is to check that it is not null. Better to 
just remove those checks.

Thanks for the bug report.
diff mbox

Patch

diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
index 0a9a5e57491a..7fcee61042c5 100644
--- a/libsepol/cil/src/cil_build_ast.c
+++ b/libsepol/cil/src/cil_build_ast.c
@@ -4256,7 +4256,7 @@  void cil_destroy_filecon(struct cil_filecon *filecon)
 	free(filecon);
 }
 
-int cil_gen_ibpkeycon(__attribute__((unused)) struct cil_db *db, struct cil_tree_node *parse_current, struct cil_tree_node *ast_node)
+int cil_gen_ibpkeycon(struct cil_db *db, struct cil_tree_node *parse_current, struct cil_tree_node *ast_node)
 {
 	enum cil_syntax syntax[] = {
 		CIL_SYN_STRING,
@@ -4667,7 +4667,7 @@  void cil_destroy_netifcon(struct cil_netifcon *netifcon)
 	free(netifcon);
 }
 
-int cil_gen_ibendportcon(__attribute__((unused)) struct cil_db *db, struct cil_tree_node *parse_current, struct cil_tree_node *ast_node)
+int cil_gen_ibendportcon(struct cil_db *db, struct cil_tree_node *parse_current, struct cil_tree_node *ast_node)
 {
 	enum cil_syntax syntax[] = {
 		CIL_SYN_STRING,