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

ivanhu ivan.hu at canonical.com
Tue Jul 31 07:50:40 UTC 2018



On 07/31/2018 02: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: Ivan Hu <ivan.hu at canonical.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180731/f68c24b1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180731/f68c24b1/attachment.sig>


More information about the fwts-devel mailing list