blob: ae3665b4d042bbb15895dedef2931dc637af097c [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 5bd05ad8569880985ddf6d4c06ed927d388c297f Mon Sep 17 00:00:00 2001
Brad Bishop6e60e8b2018-02-01 10:27:11 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 19 Oct 2016 01:57:16 +0000
4Subject: [PATCH] ignore constant-logical-operand warning with clang
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08007
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008---
9 src/dmi/dmicheck/dmicheck.c | 3 +++
10 src/lib/src/fwts_acpi_tables.c | 5 +++++
11 src/uefi/uefirtauthvar/uefirtauthvar.c | 5 +++++
12 3 files changed, 13 insertions(+)
13
14diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080015index 3cca9db9..60fb758f 100644
Brad Bishop6e60e8b2018-02-01 10:27:11 -050016--- a/src/dmi/dmicheck/dmicheck.c
17+++ b/src/dmi/dmicheck/dmicheck.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080018@@ -211,6 +211,8 @@ static const char *uuid_patterns[] = {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019 "0A0A0A0A-0A0A-0A0A-0A0A-0A0A0A0A0A0A",
20 NULL,
21 };
22+#pragma clang diagnostic push
23+#pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
24
25 static const fwts_chassis_type_map fwts_dmi_chassis_type[] = {
26 { "Invalid", FWTS_SMBIOS_CHASSIS_INVALID },
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080027@@ -251,6 +253,7 @@ static const fwts_chassis_type_map fwts_dmi_chassis_type[] = {
28 { "Mini PC", FWTS_SMBIOS_CHASSIS_MINI_PC },
29 { "Stick PC", FWTS_SMBIOS_CHASSIS_STICK_PC },
Brad Bishop6e60e8b2018-02-01 10:27:11 -050030 };
31+#pragma clang diagnostic pop
32
33 /* Remapping table from buggy version numbers to correct values */
34 static const fwts_dmi_version dmi_versions[] = {
35diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080036index c7ba59be..bdd224aa 100644
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037--- a/src/lib/src/fwts_acpi_tables.c
38+++ b/src/lib/src/fwts_acpi_tables.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080039@@ -393,10 +393,14 @@ static int fwts_acpi_handle_fadt(
Brad Bishop6e60e8b2018-02-01 10:27:11 -050040 /* Determine FACS addr and load it.
41 * Will ignore the missing FACS in the hardware-reduced mode.
42 */
43+#pragma clang diagnostic push
44+#pragma clang diagnostic ignored "-Waddress-of-packed-member"
45+
46 result = fwts_acpi_handle_fadt_tables(fw, fadt,
47 "FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL",
48 &fadt->firmware_control, &fadt->x_firmware_ctrl,
49 provenance);
50+
51 if (result != FWTS_OK) {
52 if ((result == FWTS_NULL_POINTER) &&
53 fwts_acpi_is_reduced_hardware(fadt)) {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080054@@ -415,6 +419,7 @@ static int fwts_acpi_handle_fadt(
Brad Bishop6e60e8b2018-02-01 10:27:11 -050055 return FWTS_ERROR;
56 }
57 return FWTS_OK;
58+#pragma clang diagnostic pop
59 }
60
61 /*
62diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080063index c2031741..7a33d19d 100644
Brad Bishop6e60e8b2018-02-01 10:27:11 -050064--- a/src/uefi/uefirtauthvar/uefirtauthvar.c
65+++ b/src/uefi/uefirtauthvar/uefirtauthvar.c
66@@ -142,6 +142,9 @@ static int uefirtauthvar_deinit(fwts_framework *fw)
67 return FWTS_OK;
68 }
69
70+#pragma clang diagnostic push
71+#pragma clang diagnostic ignored "-Wconstant-logical-operand"
72+
73 static int check_fw_support(fwts_framework *fw, uint64_t status)
74 {
75 if ((status == EFI_INVALID_PARAMETER) &&
76@@ -172,6 +175,8 @@ static int check_fw_support(fwts_framework *fw, uint64_t status)
77 return FWTS_OK;
78 }
79
80+#pragma clang diagnostic pop
81+
82 /*
83 * Set the created authenticated variable, AuthVarCreate,
84 * and checking the data size and data.