diff mbox

uefirtvariable: fix the uncheck return value warnings

Message ID 1417661955-5708-1-git-send-email-ivan.hu@canonical.com
State Accepted
Headers show

Commit Message

Ivan Hu Dec. 4, 2014, 2:59 a.m. UTC
Coverity Scan complains the unchecked return value of the ioctl() calls in
uefirtvariable_env_cleanup(). These return value of the calls don't need to be
cared.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/uefi/uefirtvariable/uefirtvariable.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Alex Hung Dec. 4, 2014, 6:28 a.m. UTC | #1
On 12/04/2014 10:59 AM, Ivan Hu wrote:
> Coverity Scan complains the unchecked return value of the ioctl() calls in
> uefirtvariable_env_cleanup(). These return value of the calls don't need to be
> cared.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/uefirtvariable/uefirtvariable.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
> index a19f835..94caf0d 100644
> --- a/src/uefi/uefirtvariable/uefirtvariable.c
> +++ b/src/uefi/uefirtvariable/uefirtvariable.c
> @@ -74,17 +74,17 @@ static void uefirtvariable_env_cleanup(void)
>  	setvariable.DataSize = 0;
>  	setvariable.Data = &data;
>  	setvariable.status = &status;
> -	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
> +	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
>  
>  	setvariable.VariableName = variablenametest2;
> -	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
> +	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
>  
>  	setvariable.VariableName = variablenametest3;
> -	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
> +	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
>  
>  	setvariable.VariableName = variablenametest;
>  	setvariable.VendorGuid = &gtestguid2;
> -	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
> +	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
>  }
>  
>  static int uefirtvariable_init(fwts_framework *fw)
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Colin Ian King Dec. 5, 2014, 3:54 p.m. UTC | #2
On 04/12/14 02:59, Ivan Hu wrote:
> Coverity Scan complains the unchecked return value of the ioctl() calls in
> uefirtvariable_env_cleanup(). These return value of the calls don't need to be
> cared.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/uefirtvariable/uefirtvariable.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
> index a19f835..94caf0d 100644
> --- a/src/uefi/uefirtvariable/uefirtvariable.c
> +++ b/src/uefi/uefirtvariable/uefirtvariable.c
> @@ -74,17 +74,17 @@ static void uefirtvariable_env_cleanup(void)
>  	setvariable.DataSize = 0;
>  	setvariable.Data = &data;
>  	setvariable.status = &status;
> -	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
> +	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
>  
>  	setvariable.VariableName = variablenametest2;
> -	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
> +	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
>  
>  	setvariable.VariableName = variablenametest3;
> -	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
> +	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
>  
>  	setvariable.VariableName = variablenametest;
>  	setvariable.VendorGuid = &gtestguid2;
> -	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
> +	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
>  }
>  
>  static int uefirtvariable_init(fwts_framework *fw)
> 
Thanks!

Acked-by: Colin Ian King <colin.king@canonical.com>
diff mbox

Patch

diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
index a19f835..94caf0d 100644
--- a/src/uefi/uefirtvariable/uefirtvariable.c
+++ b/src/uefi/uefirtvariable/uefirtvariable.c
@@ -74,17 +74,17 @@  static void uefirtvariable_env_cleanup(void)
 	setvariable.DataSize = 0;
 	setvariable.Data = &data;
 	setvariable.status = &status;
-	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
+	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
 
 	setvariable.VariableName = variablenametest2;
-	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
+	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
 
 	setvariable.VariableName = variablenametest3;
-	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
+	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
 
 	setvariable.VariableName = variablenametest;
 	setvariable.VendorGuid = &gtestguid2;
-	ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
+	(void)ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
 }
 
 static int uefirtvariable_init(fwts_framework *fw)