diff mbox series

uefirtvariable: indicate that return from setvariable_insertvariable is ignored

Message ID 20200113114354.166184-1-colin.king@canonical.com
State Accepted
Headers show
Series uefirtvariable: indicate that return from setvariable_insertvariable is ignored | expand

Commit Message

Colin Ian King Jan. 13, 2020, 11:43 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Voidify the return from the call to setvariable_insertvariable to indicate that
we are intentionally ignoreing the return from the function call.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/uefi/uefirtvariable/uefirtvariable.c | 26 ++++++++++++------------
 1 file changed, 13 insertions(+), 13 deletions(-)

Comments

Alex Hung Jan. 13, 2020, 6:13 p.m. UTC | #1
On 2020-01-13 4:43 a.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Voidify the return from the call to setvariable_insertvariable to indicate that
> we are intentionally ignoreing the return from the function call.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/uefi/uefirtvariable/uefirtvariable.c | 26 ++++++++++++------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
> index a1bf9cc8..fbb877a6 100644
> --- a/src/uefi/uefirtvariable/uefirtvariable.c
> +++ b/src/uefi/uefirtvariable/uefirtvariable.c
> @@ -1177,10 +1177,10 @@ static int setvariable_test1(
>  	return FWTS_OK;
>  
>  err_restore_env:
> -	setvariable_insertvariable(fw, attributes, 0, varname,
> +	(void)setvariable_insertvariable(fw, attributes, 0, varname,
>  		&gtestguid1, datadiff_g1);
>  err_restore_env1:
> -	setvariable_insertvariable(fw, attributes, 0, varname,
> +	(void)setvariable_insertvariable(fw, attributes, 0, varname,
>  		&gtestguid2, datadiff_g2);
>  
>  	return ret;
> @@ -1242,17 +1242,17 @@ static int setvariable_test2(fwts_framework *fw, uint16_t *varname)
>  	return FWTS_OK;
>  
>  err_restore_env1:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		varname, &gtestguid1, datadiff1);
>  	return ret;
>  
>  err_restore_env2:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		varname, &gtestguid1, datadiff2);
>  	return ret;
>  
>  err_restore_env3:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		varname, &gtestguid1, datadiff3);
>  	return ret;
>  }
> @@ -1311,13 +1311,13 @@ static int setvariable_test3(fwts_framework *fw)
>  	return FWTS_OK;
>  
>  err_restore_env:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		variablenametest, &gtestguid1, datadiff1);
>  err_restore_env1:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		variablenametest3, &gtestguid1, datadiff3);
>  err_restore_env2:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		variablenametest2, &gtestguid1, datadiff2);
>  
>  	return ret;
> @@ -1388,7 +1388,7 @@ static int setvariable_test6(fwts_framework *fw)
>  			/* successfully set variable with invalid attributes, test fail */
>  			fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIRuntimeSetVariable",
>  				"Successfully set variable with invalid attribute, expected fail.");
> -			setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
> +			(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
>  			return FWTS_ERROR;
>  		}
>  
> @@ -1400,7 +1400,7 @@ static int setvariable_test6(fwts_framework *fw)
>  				PRIu32 " after ExitBootServices() is "
>  				"performed, test failed.",
>  				attributesarray[index]);
> -			setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
> +			(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
>  			return FWTS_ERROR;
>  		}
>  	}
> @@ -1421,7 +1421,7 @@ static int setvariable_test7(fwts_framework *fw)
>  		fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIRuntimeSetVariable",
>  			"Successfully set variable with both authenticated (EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS "
>  			"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) attributes are set, expected fail.");
> -		setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
> +		(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
>  		return FWTS_ERROR;
>  	}
>  
> @@ -1432,7 +1432,7 @@ static int setvariable_test7(fwts_framework *fw)
>  			"authenticated (EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS "
>  			"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) "
>  			"attributes are set %" PRIu32 " , test failed.", attr);
> -		setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
> +		(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
>  		return FWTS_ERROR;
>  	}
>  	return FWTS_OK;
> @@ -1773,7 +1773,7 @@ static int uefirtvariable_test6(fwts_framework *fw)
>  			variablenametest, &gtestguid1, datadiff);
>  		if (ret != FWTS_OK) {
>  			if (i > 0)
> -				setvariable_insertvariable(fw, attributes, 0, variablenametest,
> +				(void)setvariable_insertvariable(fw, attributes, 0, variablenametest,
>  										&gtestguid1, datadiff);
>  			return ret;
>  		}
> 
Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Jan. 14, 2020, 4:20 a.m. UTC | #2
On 1/13/20 7:43 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Voidify the return from the call to setvariable_insertvariable to indicate that
> we are intentionally ignoreing the return from the function call.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/uefi/uefirtvariable/uefirtvariable.c | 26 ++++++++++++------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
> index a1bf9cc8..fbb877a6 100644
> --- a/src/uefi/uefirtvariable/uefirtvariable.c
> +++ b/src/uefi/uefirtvariable/uefirtvariable.c
> @@ -1177,10 +1177,10 @@ static int setvariable_test1(
>  	return FWTS_OK;
>  
>  err_restore_env:
> -	setvariable_insertvariable(fw, attributes, 0, varname,
> +	(void)setvariable_insertvariable(fw, attributes, 0, varname,
>  		&gtestguid1, datadiff_g1);
>  err_restore_env1:
> -	setvariable_insertvariable(fw, attributes, 0, varname,
> +	(void)setvariable_insertvariable(fw, attributes, 0, varname,
>  		&gtestguid2, datadiff_g2);
>  
>  	return ret;
> @@ -1242,17 +1242,17 @@ static int setvariable_test2(fwts_framework *fw, uint16_t *varname)
>  	return FWTS_OK;
>  
>  err_restore_env1:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		varname, &gtestguid1, datadiff1);
>  	return ret;
>  
>  err_restore_env2:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		varname, &gtestguid1, datadiff2);
>  	return ret;
>  
>  err_restore_env3:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		varname, &gtestguid1, datadiff3);
>  	return ret;
>  }
> @@ -1311,13 +1311,13 @@ static int setvariable_test3(fwts_framework *fw)
>  	return FWTS_OK;
>  
>  err_restore_env:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		variablenametest, &gtestguid1, datadiff1);
>  err_restore_env1:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		variablenametest3, &gtestguid1, datadiff3);
>  err_restore_env2:
> -	setvariable_insertvariable(fw, attributes, 0,
> +	(void)setvariable_insertvariable(fw, attributes, 0,
>  		variablenametest2, &gtestguid1, datadiff2);
>  
>  	return ret;
> @@ -1388,7 +1388,7 @@ static int setvariable_test6(fwts_framework *fw)
>  			/* successfully set variable with invalid attributes, test fail */
>  			fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIRuntimeSetVariable",
>  				"Successfully set variable with invalid attribute, expected fail.");
> -			setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
> +			(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
>  			return FWTS_ERROR;
>  		}
>  
> @@ -1400,7 +1400,7 @@ static int setvariable_test6(fwts_framework *fw)
>  				PRIu32 " after ExitBootServices() is "
>  				"performed, test failed.",
>  				attributesarray[index]);
> -			setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
> +			(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
>  			return FWTS_ERROR;
>  		}
>  	}
> @@ -1421,7 +1421,7 @@ static int setvariable_test7(fwts_framework *fw)
>  		fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIRuntimeSetVariable",
>  			"Successfully set variable with both authenticated (EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS "
>  			"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) attributes are set, expected fail.");
> -		setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
> +		(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
>  		return FWTS_ERROR;
>  	}
>  
> @@ -1432,7 +1432,7 @@ static int setvariable_test7(fwts_framework *fw)
>  			"authenticated (EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS "
>  			"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) "
>  			"attributes are set %" PRIu32 " , test failed.", attr);
> -		setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
> +		(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
>  		return FWTS_ERROR;
>  	}
>  	return FWTS_OK;
> @@ -1773,7 +1773,7 @@ static int uefirtvariable_test6(fwts_framework *fw)
>  			variablenametest, &gtestguid1, datadiff);
>  		if (ret != FWTS_OK) {
>  			if (i > 0)
> -				setvariable_insertvariable(fw, attributes, 0, variablenametest,
> +				(void)setvariable_insertvariable(fw, attributes, 0, variablenametest,
>  										&gtestguid1, datadiff);
>  			return ret;
>  		}
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
index a1bf9cc8..fbb877a6 100644
--- a/src/uefi/uefirtvariable/uefirtvariable.c
+++ b/src/uefi/uefirtvariable/uefirtvariable.c
@@ -1177,10 +1177,10 @@  static int setvariable_test1(
 	return FWTS_OK;
 
 err_restore_env:
-	setvariable_insertvariable(fw, attributes, 0, varname,
+	(void)setvariable_insertvariable(fw, attributes, 0, varname,
 		&gtestguid1, datadiff_g1);
 err_restore_env1:
-	setvariable_insertvariable(fw, attributes, 0, varname,
+	(void)setvariable_insertvariable(fw, attributes, 0, varname,
 		&gtestguid2, datadiff_g2);
 
 	return ret;
@@ -1242,17 +1242,17 @@  static int setvariable_test2(fwts_framework *fw, uint16_t *varname)
 	return FWTS_OK;
 
 err_restore_env1:
-	setvariable_insertvariable(fw, attributes, 0,
+	(void)setvariable_insertvariable(fw, attributes, 0,
 		varname, &gtestguid1, datadiff1);
 	return ret;
 
 err_restore_env2:
-	setvariable_insertvariable(fw, attributes, 0,
+	(void)setvariable_insertvariable(fw, attributes, 0,
 		varname, &gtestguid1, datadiff2);
 	return ret;
 
 err_restore_env3:
-	setvariable_insertvariable(fw, attributes, 0,
+	(void)setvariable_insertvariable(fw, attributes, 0,
 		varname, &gtestguid1, datadiff3);
 	return ret;
 }
@@ -1311,13 +1311,13 @@  static int setvariable_test3(fwts_framework *fw)
 	return FWTS_OK;
 
 err_restore_env:
-	setvariable_insertvariable(fw, attributes, 0,
+	(void)setvariable_insertvariable(fw, attributes, 0,
 		variablenametest, &gtestguid1, datadiff1);
 err_restore_env1:
-	setvariable_insertvariable(fw, attributes, 0,
+	(void)setvariable_insertvariable(fw, attributes, 0,
 		variablenametest3, &gtestguid1, datadiff3);
 err_restore_env2:
-	setvariable_insertvariable(fw, attributes, 0,
+	(void)setvariable_insertvariable(fw, attributes, 0,
 		variablenametest2, &gtestguid1, datadiff2);
 
 	return ret;
@@ -1388,7 +1388,7 @@  static int setvariable_test6(fwts_framework *fw)
 			/* successfully set variable with invalid attributes, test fail */
 			fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIRuntimeSetVariable",
 				"Successfully set variable with invalid attribute, expected fail.");
-			setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
+			(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
 			return FWTS_ERROR;
 		}
 
@@ -1400,7 +1400,7 @@  static int setvariable_test6(fwts_framework *fw)
 				PRIu32 " after ExitBootServices() is "
 				"performed, test failed.",
 				attributesarray[index]);
-			setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
+			(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
 			return FWTS_ERROR;
 		}
 	}
@@ -1421,7 +1421,7 @@  static int setvariable_test7(fwts_framework *fw)
 		fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIRuntimeSetVariable",
 			"Successfully set variable with both authenticated (EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS "
 			"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) attributes are set, expected fail.");
-		setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
+		(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
 		return FWTS_ERROR;
 	}
 
@@ -1432,7 +1432,7 @@  static int setvariable_test7(fwts_framework *fw)
 			"authenticated (EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS "
 			"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) "
 			"attributes are set %" PRIu32 " , test failed.", attr);
-		setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
+		(void)setvariable_insertvariable(fw, 0, datasize, variablenametest, &gtestguid1, datadiff);
 		return FWTS_ERROR;
 	}
 	return FWTS_OK;
@@ -1773,7 +1773,7 @@  static int uefirtvariable_test6(fwts_framework *fw)
 			variablenametest, &gtestguid1, datadiff);
 		if (ret != FWTS_OK) {
 			if (i > 0)
-				setvariable_insertvariable(fw, attributes, 0, variablenametest,
+				(void)setvariable_insertvariable(fw, attributes, 0, variablenametest,
 										&gtestguid1, datadiff);
 			return ret;
 		}