From patchwork Mon Jul 30 18:30:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 951262 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41fSnS4dcjz9s2x; Tue, 31 Jul 2018 04:31:08 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fkCwk-0002v4-3p; Mon, 30 Jul 2018 18:31:06 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fkCwh-0002tz-8z for fwts-devel@lists.ubuntu.com; Mon, 30 Jul 2018 18:31:03 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fkCwg-0006sQ-VJ; Mon, 30 Jul 2018 18:31:03 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 6/7] uefi: uefirtauthvar: don't logically or a constant operand. Date: Mon, 30 Jul 2018 19:30:58 +0100 Message-Id: <20180730183059.28039-7-colin.king@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730183059.28039-1-colin.king@canonical.com> References: <20180730183059.28039-1-colin.king@canonical.com> MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" From: Colin Ian King 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 Acked-by: Alex Hung Acked-by: Ivan Hu --- 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, "