Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 1 | From 953cff93c85d3cfd5cbcac56e14443dc5f6e5fbd Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Wed, 19 Oct 2016 01:57:16 +0000 |
| 4 | Subject: [PATCH] ignore constant-logical-operand warning with clang |
| 5 | |
| 6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 7 | --- |
| 8 | src/dmi/dmicheck/dmicheck.c | 3 +++ |
| 9 | src/lib/src/fwts_acpi_tables.c | 5 +++++ |
| 10 | src/uefi/uefirtauthvar/uefirtauthvar.c | 5 +++++ |
| 11 | 3 files changed, 13 insertions(+) |
| 12 | |
| 13 | diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c |
| 14 | index ecd98223..7fca4a64 100644 |
| 15 | --- a/src/dmi/dmicheck/dmicheck.c |
| 16 | +++ b/src/dmi/dmicheck/dmicheck.c |
| 17 | @@ -209,6 +209,8 @@ static const char *uuid_patterns[] = { |
| 18 | "0A0A0A0A-0A0A-0A0A-0A0A-0A0A0A0A0A0A", |
| 19 | NULL, |
| 20 | }; |
| 21 | +#pragma clang diagnostic push |
| 22 | +#pragma clang diagnostic ignored "-Wunneeded-internal-declaration" |
| 23 | |
| 24 | static const fwts_chassis_type_map fwts_dmi_chassis_type[] = { |
| 25 | { "Invalid", FWTS_SMBIOS_CHASSIS_INVALID }, |
| 26 | @@ -245,6 +247,7 @@ static const fwts_chassis_type_map fwts_dmi_chassis_type[] = { |
| 27 | { "Convertible", FWTS_SMBIOS_CHASSIS_CONVERTIBLE }, |
| 28 | { "Detachable", FWTS_SMBIOS_CHASSIS_DETACHABLE }, |
| 29 | }; |
| 30 | +#pragma clang diagnostic pop |
| 31 | |
| 32 | /* Remapping table from buggy version numbers to correct values */ |
| 33 | static const fwts_dmi_version dmi_versions[] = { |
| 34 | diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c |
| 35 | index 30b4060e..d5339bf7 100644 |
| 36 | --- a/src/lib/src/fwts_acpi_tables.c |
| 37 | +++ b/src/lib/src/fwts_acpi_tables.c |
| 38 | @@ -394,10 +394,14 @@ static int fwts_acpi_handle_fadt( |
| 39 | /* Determine FACS addr and load it. |
| 40 | * Will ignore the missing FACS in the hardware-reduced mode. |
| 41 | */ |
| 42 | +#pragma clang diagnostic push |
| 43 | +#pragma clang diagnostic ignored "-Waddress-of-packed-member" |
| 44 | + |
| 45 | result = fwts_acpi_handle_fadt_tables(fw, fadt, |
| 46 | "FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL", |
| 47 | &fadt->firmware_control, &fadt->x_firmware_ctrl, |
| 48 | provenance); |
| 49 | + |
| 50 | if (result != FWTS_OK) { |
| 51 | if ((result == FWTS_NULL_POINTER) && |
| 52 | fwts_acpi_is_reduced_hardware(fadt)) { |
| 53 | @@ -416,6 +420,7 @@ static int fwts_acpi_handle_fadt( |
| 54 | return FWTS_ERROR; |
| 55 | } |
| 56 | return FWTS_OK; |
| 57 | +#pragma clang diagnostic pop |
| 58 | } |
| 59 | |
| 60 | /* |
| 61 | diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c |
| 62 | index cdfd7aa3..001e8cc8 100644 |
| 63 | --- a/src/uefi/uefirtauthvar/uefirtauthvar.c |
| 64 | +++ b/src/uefi/uefirtauthvar/uefirtauthvar.c |
| 65 | @@ -142,6 +142,9 @@ static int uefirtauthvar_deinit(fwts_framework *fw) |
| 66 | return FWTS_OK; |
| 67 | } |
| 68 | |
| 69 | +#pragma clang diagnostic push |
| 70 | +#pragma clang diagnostic ignored "-Wconstant-logical-operand" |
| 71 | + |
| 72 | static int check_fw_support(fwts_framework *fw, uint64_t status) |
| 73 | { |
| 74 | if ((status == EFI_INVALID_PARAMETER) && |
| 75 | @@ -172,6 +175,8 @@ static int check_fw_support(fwts_framework *fw, uint64_t status) |
| 76 | return FWTS_OK; |
| 77 | } |
| 78 | |
| 79 | +#pragma clang diagnostic pop |
| 80 | + |
| 81 | /* |
| 82 | * Set the created authenticated variable, AuthVarCreate, |
| 83 | * and checking the data size and data. |