Message ID | 20180730183059.28039-5-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | abstract _Pragmas and minor changes to build with gcc and clang | expand |
On 2018-07-30 11:30 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > clang warns when we take the address of an object inside a > packed structure. Disable this warning as I believe this > is OK for architectures that perform this operation. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_acpi_tables.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c > index c7ba59be..f28ed60a 100644 > --- a/src/lib/src/fwts_acpi_tables.c > +++ b/src/lib/src/fwts_acpi_tables.c > @@ -393,10 +393,13 @@ static int fwts_acpi_handle_fadt( > /* Determine FACS addr and load it. > * Will ignore the missing FACS in the hardware-reduced mode. > */ > +PRAGMA_PUSH > +PRAGMA_PACK_WARN_OFF > result = fwts_acpi_handle_fadt_tables(fw, fadt, > "FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL", > &fadt->firmware_control, &fadt->x_firmware_ctrl, > provenance); > +PRAGMA_POP > if (result != FWTS_OK) { > if ((result == FWTS_NULL_POINTER) && > fwts_acpi_is_reduced_hardware(fadt)) { > @@ -408,12 +411,15 @@ static int fwts_acpi_handle_fadt( > } > } > /* Determine DSDT addr and load it */ > +PRAGMA_PUSH > +PRAGMA_PACK_WARN_OFF > if (fwts_acpi_handle_fadt_tables(fw, fadt, > "DSDT", "DSTD", "X_DSDT", > &fadt->dsdt, &fadt->x_dsdt, provenance) != FWTS_OK) { > fwts_log_error(fw, "Failed to load DSDT."); > return FWTS_ERROR; > } > +PRAGMA_POP > return FWTS_OK; > } > > Acked-by: Alex Hung <alex.hung@canonical.com>
On 07/31/2018 02:30 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > clang warns when we take the address of an object inside a > packed structure. Disable this warning as I believe this > is OK for architectures that perform this operation. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_acpi_tables.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c > index c7ba59be..f28ed60a 100644 > --- a/src/lib/src/fwts_acpi_tables.c > +++ b/src/lib/src/fwts_acpi_tables.c > @@ -393,10 +393,13 @@ static int fwts_acpi_handle_fadt( > /* Determine FACS addr and load it. > * Will ignore the missing FACS in the hardware-reduced mode. > */ > +PRAGMA_PUSH > +PRAGMA_PACK_WARN_OFF > result = fwts_acpi_handle_fadt_tables(fw, fadt, > "FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL", > &fadt->firmware_control, &fadt->x_firmware_ctrl, > provenance); > +PRAGMA_POP > if (result != FWTS_OK) { > if ((result == FWTS_NULL_POINTER) && > fwts_acpi_is_reduced_hardware(fadt)) { > @@ -408,12 +411,15 @@ static int fwts_acpi_handle_fadt( > } > } > /* Determine DSDT addr and load it */ > +PRAGMA_PUSH > +PRAGMA_PACK_WARN_OFF > if (fwts_acpi_handle_fadt_tables(fw, fadt, > "DSDT", "DSTD", "X_DSDT", > &fadt->dsdt, &fadt->x_dsdt, provenance) != FWTS_OK) { > fwts_log_error(fw, "Failed to load DSDT."); > return FWTS_ERROR; > } > +PRAGMA_POP > return FWTS_OK; > } > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c index c7ba59be..f28ed60a 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -393,10 +393,13 @@ static int fwts_acpi_handle_fadt( /* Determine FACS addr and load it. * Will ignore the missing FACS in the hardware-reduced mode. */ +PRAGMA_PUSH +PRAGMA_PACK_WARN_OFF result = fwts_acpi_handle_fadt_tables(fw, fadt, "FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL", &fadt->firmware_control, &fadt->x_firmware_ctrl, provenance); +PRAGMA_POP if (result != FWTS_OK) { if ((result == FWTS_NULL_POINTER) && fwts_acpi_is_reduced_hardware(fadt)) { @@ -408,12 +411,15 @@ static int fwts_acpi_handle_fadt( } } /* Determine DSDT addr and load it */ +PRAGMA_PUSH +PRAGMA_PACK_WARN_OFF if (fwts_acpi_handle_fadt_tables(fw, fadt, "DSDT", "DSTD", "X_DSDT", &fadt->dsdt, &fadt->x_dsdt, provenance) != FWTS_OK) { fwts_log_error(fw, "Failed to load DSDT."); return FWTS_ERROR; } +PRAGMA_POP return FWTS_OK; }