Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 5bd05ad8569880985ddf6d4c06ed927d388c297f Mon Sep 17 00:00:00 2001 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 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> |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 7 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 8 | --- |
| 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 | |
| 14 | diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 15 | index 3cca9db9..60fb758f 100644 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 16 | --- a/src/dmi/dmicheck/dmicheck.c |
| 17 | +++ b/src/dmi/dmicheck/dmicheck.c |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 18 | @@ -211,6 +211,8 @@ static const char *uuid_patterns[] = { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 19 | "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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 27 | @@ -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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 30 | }; |
| 31 | +#pragma clang diagnostic pop |
| 32 | |
| 33 | /* Remapping table from buggy version numbers to correct values */ |
| 34 | static const fwts_dmi_version dmi_versions[] = { |
| 35 | diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 36 | index c7ba59be..bdd224aa 100644 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 37 | --- a/src/lib/src/fwts_acpi_tables.c |
| 38 | +++ b/src/lib/src/fwts_acpi_tables.c |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 39 | @@ -393,10 +393,14 @@ static int fwts_acpi_handle_fadt( |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 40 | /* 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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 54 | @@ -415,6 +419,7 @@ static int fwts_acpi_handle_fadt( |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 55 | return FWTS_ERROR; |
| 56 | } |
| 57 | return FWTS_OK; |
| 58 | +#pragma clang diagnostic pop |
| 59 | } |
| 60 | |
| 61 | /* |
| 62 | diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 63 | index c2031741..7a33d19d 100644 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 64 | --- 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. |