From patchwork Mon Jan 13 11:43:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 1222096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47xBZ92x72z9s29; Mon, 13 Jan 2020 22:44:00 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iqy8T-0002Kx-RW; Mon, 13 Jan 2020 11:43:57 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iqy8R-0002Kq-G1 for fwts-devel@lists.ubuntu.com; Mon, 13 Jan 2020 11:43:55 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iqy8R-0000Mv-5X; Mon, 13 Jan 2020 11:43:55 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] uefirtvariable: indicate that return from setvariable_insertvariable is ignored Date: Mon, 13 Jan 2020 11:43:54 +0000 Message-Id: <20200113114354.166184-1-colin.king@canonical.com> X-Mailer: git-send-email 2.24.0 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 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 Acked-by: Alex Hung Acked-by: Ivan Hu --- 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, >estguid1, datadiff_g1); err_restore_env1: - setvariable_insertvariable(fw, attributes, 0, varname, + (void)setvariable_insertvariable(fw, attributes, 0, varname, >estguid2, 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, >estguid1, datadiff1); return ret; err_restore_env2: - setvariable_insertvariable(fw, attributes, 0, + (void)setvariable_insertvariable(fw, attributes, 0, varname, >estguid1, datadiff2); return ret; err_restore_env3: - setvariable_insertvariable(fw, attributes, 0, + (void)setvariable_insertvariable(fw, attributes, 0, varname, >estguid1, 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, >estguid1, datadiff1); err_restore_env1: - setvariable_insertvariable(fw, attributes, 0, + (void)setvariable_insertvariable(fw, attributes, 0, variablenametest3, >estguid1, datadiff3); err_restore_env2: - setvariable_insertvariable(fw, attributes, 0, + (void)setvariable_insertvariable(fw, attributes, 0, variablenametest2, >estguid1, 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, >estguid1, datadiff); + (void)setvariable_insertvariable(fw, 0, datasize, variablenametest, >estguid1, 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, >estguid1, datadiff); + (void)setvariable_insertvariable(fw, 0, datasize, variablenametest, >estguid1, 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, >estguid1, datadiff); + (void)setvariable_insertvariable(fw, 0, datasize, variablenametest, >estguid1, 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, >estguid1, datadiff); + (void)setvariable_insertvariable(fw, 0, datasize, variablenametest, >estguid1, datadiff); return FWTS_ERROR; } return FWTS_OK; @@ -1773,7 +1773,7 @@ static int uefirtvariable_test6(fwts_framework *fw) variablenametest, >estguid1, datadiff); if (ret != FWTS_OK) { if (i > 0) - setvariable_insertvariable(fw, attributes, 0, variablenametest, + (void)setvariable_insertvariable(fw, attributes, 0, variablenametest, >estguid1, datadiff); return ret; }