ACK: [PATCH 6/7] uefi: uefirtauthvar: don't logically or a constant operand.

Alex Hung alex.hung at canonical.com
Tue Jul 31 00:13:01 UTC 2018


On 2018-07-30 11:30 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> Cast constant operands to bool type so that the logical or does not
> result in a clang warning.
> 
> Fixes clang build warning:
> 
> uefi/uefirtauthvar/uefirtauthvar.c:148:65: error: use of logical '||' with
> constant operand [-Werror,-Wconstant-logical-operand]
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/uefi/uefirtauthvar/uefirtauthvar.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c
> index c2031741..7384ae3d 100644
> --- a/src/uefi/uefirtauthvar/uefirtauthvar.c
> +++ b/src/uefi/uefirtauthvar/uefirtauthvar.c
> @@ -145,9 +145,9 @@ static int uefirtauthvar_deinit(fwts_framework *fw)
>   static int check_fw_support(fwts_framework *fw, uint64_t status)
>   {
>   	if ((status == EFI_INVALID_PARAMETER) &&
> -		((attributes & FWTS_UEFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) ||
> -		(attributes & FWTS_UEFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) ||
> -		(attributes & FWTS_UEFI_VARIABLE_APPEND_WRITE))) {
> +		((bool)(attributes & FWTS_UEFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) ||
> +		 (bool)(attributes & FWTS_UEFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) ||
> +		 (bool)(attributes & FWTS_UEFI_VARIABLE_APPEND_WRITE))) {
>   		fwts_uefi_print_status_info(fw, status);
>   		fwts_skipped(fw,
>   			"EFI_INVALID_PARAMETER shall be returned, "
> 

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list