diff mbox

[1/2] libsepol: do not use handle when it is marked unused

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

Commit Message

Nicolas Iooss May 31, 2017, 8:06 p.m. UTC
Assigning NULL to handle does not perform anything useful and clang
complains about this:

    ibendports.c:122:2: error: 'handle' was marked unused but was used
    [-Werror,-Wused-but-marked-unused]
        handle = NULL;
        ^
    ibpkeys.c:115:2: error: 'handle' was marked unused but was used
    [-Werror,-Wused-but-marked-unused]
        handle = NULL;
        ^

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 libsepol/src/ibendports.c | 1 -
 libsepol/src/ibpkeys.c    | 1 -
 2 files changed, 2 deletions(-)

Comments

James Carter June 1, 2017, 5 p.m. UTC | #1
On 05/31/2017 04:06 PM, Nicolas Iooss wrote:
> Assigning NULL to handle does not perform anything useful and clang
> complains about this:
> 
>      ibendports.c:122:2: error: 'handle' was marked unused but was used
>      [-Werror,-Wused-but-marked-unused]
>          handle = NULL;
>          ^
>      ibpkeys.c:115:2: error: 'handle' was marked unused but was used
>      [-Werror,-Wused-but-marked-unused]
>          handle = NULL;
>          ^
> 
> Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Applied.

Thanks,
Jim

> ---
>   libsepol/src/ibendports.c | 1 -
>   libsepol/src/ibpkeys.c    | 1 -
>   2 files changed, 2 deletions(-)
> 
> diff --git a/libsepol/src/ibendports.c b/libsepol/src/ibendports.c
> index 0438093e3053..6d56c9a1793f 100644
> --- a/libsepol/src/ibendports.c
> +++ b/libsepol/src/ibendports.c
> @@ -119,7 +119,6 @@ extern int sepol_ibendport_count(sepol_handle_t *handle __attribute__ ((unused))
>   
>   	*response = count;
>   
> -	handle = NULL;
>   	return STATUS_SUCCESS;
>   }
>   
> diff --git a/libsepol/src/ibpkeys.c b/libsepol/src/ibpkeys.c
> index ad6c07fe2c2d..682bf5db210c 100644
> --- a/libsepol/src/ibpkeys.c
> +++ b/libsepol/src/ibpkeys.c
> @@ -112,7 +112,6 @@ extern int sepol_ibpkey_count(sepol_handle_t *handle __attribute__ ((unused)),
>   
>   	*response = count;
>   
> -	handle = NULL;
>   	return STATUS_SUCCESS;
>   }
>   
>
diff mbox

Patch

diff --git a/libsepol/src/ibendports.c b/libsepol/src/ibendports.c
index 0438093e3053..6d56c9a1793f 100644
--- a/libsepol/src/ibendports.c
+++ b/libsepol/src/ibendports.c
@@ -119,7 +119,6 @@  extern int sepol_ibendport_count(sepol_handle_t *handle __attribute__ ((unused))
 
 	*response = count;
 
-	handle = NULL;
 	return STATUS_SUCCESS;
 }
 
diff --git a/libsepol/src/ibpkeys.c b/libsepol/src/ibpkeys.c
index ad6c07fe2c2d..682bf5db210c 100644
--- a/libsepol/src/ibpkeys.c
+++ b/libsepol/src/ibpkeys.c
@@ -112,7 +112,6 @@  extern int sepol_ibpkey_count(sepol_handle_t *handle __attribute__ ((unused)),
 
 	*response = count;
 
-	handle = NULL;
 	return STATUS_SUCCESS;
 }