Message ID | 1437019263-12552-1-git-send-email-alex.hung@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 16/07/15 05:01, Alex Hung wrote: > Signed-off-by: Alex Hung <alex.hung@canonical.com> > --- > src/acpi/acpidump/acpidump.c | 36 ++++++++++++++++++------------------ > src/acpi/checksum/checksum.c | 4 ++-- > src/acpi/cstates/cstates.c | 2 +- > src/acpi/fan/fan.c | 4 ++-- > src/acpi/method/method.c | 4 ++-- > src/acpi/s3power/s3power.c | 2 +- > src/acpi/xenv/xenv.c | 1 - > src/lib/include/fwts_acpi.h | 16 ++++++++-------- > 8 files changed, 34 insertions(+), 35 deletions(-) > > diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c > index c55956c..e1f2513 100644 > --- a/src/acpi/acpidump/acpidump.c > +++ b/src/acpi/acpidump/acpidump.c > @@ -137,7 +137,7 @@ static uint64_t apci_dump_get_uint64_t( > case 8: > memcpy(&ret, data, info->size); > break; > - default: > + default: > ret = 0; > ptr = (uint8_t *)data; > for (i = 0; (i < info->size) && (i < 8); i++) { > @@ -174,7 +174,7 @@ static void acpi_dump_uint( > acpi_dump_field_info(info->label, info->size, info->offset + offset), > hexdigits, hexdigits, val); > break; > - default: > + default: > ptr = (uint8_t *)data; > for (i = 0; i < info->size; i++) { > uint8_t val8 = *ptr++; > @@ -305,7 +305,7 @@ static char *acpi_dump_gas_address_space_id(const uint64_t index) > char *txt; > > switch (index) { > - case 0x00: > + case 0x00: > txt = "System Memory"; > break; > case 0x01: > @@ -334,7 +334,7 @@ static char *acpi_dump_gas_address_space_id(const uint64_t index) > txt = "Unknown"; > break; > } > - > + > return txt; > } > > @@ -343,7 +343,7 @@ static void acpi_dump_gas( > const fwts_acpidump_field *info, > const void *data, > const int offset) > -{ > +{ > static const char *access_width[] = { > "Undefined (legacy reasons)", > "Byte Access", > @@ -367,7 +367,7 @@ static void acpi_dump_gas( > fwts_log_nl(fw); > fwts_log_info_verbatum(fw, "%s (Generic Address Structure)", > acpi_dump_field_info(info->label, info->size, offset + info->offset)); > - > + > __acpi_dump_table_fields(fw, data, fields, offset + info->offset); > } > > @@ -430,7 +430,7 @@ static void acpidump_boot(fwts_framework *fw, const fwts_acpi_table_info *table) > fwts_log_info_verbatum(fw, "%56.56s: %x", "Parity", (cmos_data & FWTS_BOOT_REGISTER_PARITY) ? 1 : 0); > } else > fwts_log_error(fw, "Cannot get read/write permission on I/O ports."); > - > + > } > > static void acpidump_bert(fwts_framework *fw, const fwts_acpi_table_info *table) > @@ -491,7 +491,7 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) > "BEGIN_READ_OPERATION", > "BEGIN_CLEAR_OPERATION", > "END_OPERATION", > - > + > "SET_RECORD_offsetof", > "EXECUTE_OPERATION", > "CHECK_BUSY_STATUS", > @@ -499,9 +499,9 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) > > "GET_RECORD_IDENTIFIER", > "SET_RECORD_IDENTIFIER", > - "GET_RECOERD_COUNT", > + "GET_RECOERD_COUNT", > "BEGIN_DUMMY_WRITE_OPERATION", > - > + > "RESERVED", > "GET_ERROR_LOG_ADDRESS_RANGE", > "GET_ERROR_LOG_ADDRESS_RANGE_LENGTH", > @@ -517,8 +517,8 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) > "NOOP", > "LOAD_VAR1", > "LOAD_VAR2", > - "STORE_VAR1", > - > + "STORE_VAR1", > + > "ADD", > "SUBTRACT", > "ADD_VALUE", > @@ -543,7 +543,7 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) > }; > > acpi_dump_table_fields(fw, table->data, fields, 0, table->length); > - > + > for (i = 0; i < erst->instruction_entry_count; i++) { > fwts_acpidump_field entry_fields[] = { > FIELD_STRS(" Action", fwts_acpi_table_erst, entries[i].serialization_action, serialization_actions, 16), > @@ -770,7 +770,7 @@ static void acpidump_madt(fwts_framework *fw, const fwts_acpi_table_info *table) > uint8_t *data = (uint8_t *)table->data; > size_t offset = 0; > int i = 0; > - > + > static const fwts_acpidump_field fields[] = { > FIELD_UINT("Local APIC Address", fwts_acpi_table_madt, lapic_address), > FIELD_UINT("Flags", fwts_acpi_table_madt, flags), > @@ -801,9 +801,9 @@ static void acpidump_madt(fwts_framework *fw, const fwts_acpi_table_info *table) > }; > > acpi_dump_table_fields(fw, data, fields, 0, table->length); > - > + > offset += sizeof(fwts_acpi_table_madt); > - data += sizeof(fwts_acpi_table_madt); > + data += sizeof(fwts_acpi_table_madt); > > > while (offset < table->length) { > @@ -1837,11 +1837,11 @@ static void acpidump_pcct(fwts_framework *fw, const fwts_acpi_table_info *table) > > /* Currently just type 0 is supported */ > switch (header->type) { > - case 0: > + case 0: > fwts_log_info_verbatum(fw, > "General Communications Subspace Structure (type 0):"); > __acpi_dump_table_fields(fw, ptr, type0_fields, ptr - data); > - > + > break; > default: > break; > diff --git a/src/acpi/checksum/checksum.c b/src/acpi/checksum/checksum.c > index a649231..68b23d1 100644 > --- a/src/acpi/checksum/checksum.c > +++ b/src/acpi/checksum/checksum.c > @@ -57,7 +57,7 @@ static void checksum_rsdp(fwts_framework *fw, fwts_acpi_table_info *table) > fwts_passed(fw, "Table RSDP has correct checksum 0x%2.2" PRIx8 ".", > rsdp->checksum); > > - /* > + /* > * Version 2.0 RSP or more. Note ACPI 1.0 is indicated by a > * zero version number > */ > @@ -80,7 +80,7 @@ static void checksum_rsdp(fwts_framework *fw, fwts_acpi_table_info *table) > "expected 0x%2.2" PRIx8 ", got 0x%2.2" PRIx8 ".", > (uint8_t)(rsdp->extended_checksum-checksum), > rsdp->extended_checksum); > - fwts_advice(fw, > + fwts_advice(fw, > "The kernel will not load the RSDP with an " > "invalid extended checksum and hence all " > "other ACPI tables will also fail to load."); > diff --git a/src/acpi/cstates/cstates.c b/src/acpi/cstates/cstates.c > index 1e9e00f..4bced4d 100644 > --- a/src/acpi/cstates/cstates.c > +++ b/src/acpi/cstates/cstates.c > @@ -86,7 +86,7 @@ static void get_cstates(char *path, fwts_cstates *state) > nr = 0; > else { > char *ptr = strstr(data, "-C"); > - if (ptr) > + if (ptr) > nr = strtol(ptr + 2, NULL, 10); > else > nr = 0; > diff --git a/src/acpi/fan/fan.c b/src/acpi/fan/fan.c > index 807989f..8da197f 100644 > --- a/src/acpi/fan/fan.c > +++ b/src/acpi/fan/fan.c > @@ -122,7 +122,7 @@ static fwts_list *get_fan_info(fwts_framework *fw) > } while (entry); > > closedir(dir); > - > + > return fans; > } > > @@ -243,7 +243,7 @@ static int fan_test2(fwts_framework *fw) > "to the driver and/or the fan speed is automatically being " > "controlled by firmware using System Management Mode in which case " > "the kernel interfaces being examined may not work anyway."); > - > + > > } > > diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c > index cd2baa4..e93a644 100644 > --- a/src/acpi/method/method.c > +++ b/src/acpi/method/method.c > @@ -2911,7 +2911,7 @@ static void method_test_CPC_return( > { ACPI_TYPE_BUFFER, "Maximum Performance Register" }, > { ACPI_TYPE_BUFFER, "Performance Reduction Tolerance Register" }, > { ACPI_TYPE_BUFFER, "Timed Window Register" }, > - { ACPI_TYPE_INTBUF, "Counter Wraparound Time" }, > + { ACPI_TYPE_INTBUF, "Counter Wraparound Time" }, > { ACPI_TYPE_BUFFER, "Nominal Counter Register" }, > { ACPI_TYPE_BUFFER, "Delivered Counter Register" }, > { ACPI_TYPE_BUFFER, "Performance Limited Register" }, > @@ -4876,7 +4876,7 @@ static int method_test_PIF(fwts_framework *fw) > } > > /* > - * Section 10.4 Power Meters > + * Section 10.4 Power Meters > */ > > static int method_test_GAI(fwts_framework *fw) > diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c > index dfe5b93..ba5f1bb 100644 > --- a/src/acpi/s3power/s3power.c > +++ b/src/acpi/s3power/s3power.c > @@ -50,7 +50,7 @@ static int s3power_adapter_offline(fwts_framework *fw, bool *offline) > /* Any online, then we're not totally offlined */ > > *offline = matching > 0 ? false : true; > - > + > return FWTS_OK; > } > > diff --git a/src/acpi/xenv/xenv.c b/src/acpi/xenv/xenv.c > index db8379a..c56e048 100644 > --- a/src/acpi/xenv/xenv.c > +++ b/src/acpi/xenv/xenv.c > @@ -97,4 +97,3 @@ static fwts_framework_ops xenv_check_ops = { > > FWTS_REGISTER("xenv", &xenv_check_ops, FWTS_TEST_ANYTIME, > FWTS_FLAG_BATCH | FWTS_FLAG_TEST_ACPI) > - > diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h > index 65d5e12..c113dd1 100644 > --- a/src/lib/include/fwts_acpi.h > +++ b/src/lib/include/fwts_acpi.h > @@ -78,13 +78,13 @@ typedef struct { > } __attribute__ ((packed)) fwts_acpi_table_header; > > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > uint8_t cmos_index; > uint8_t reserved[3]; > } __attribute__ ((packed)) fwts_acpi_table_boot; > > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > uint32_t boot_error_region_length; > uint64_t boot_error_region; > } __attribute__ ((packed)) fwts_acpi_table_bert; > @@ -107,13 +107,13 @@ typedef struct { > } __attribute__ ((packed)) fwts_acpi_cpep_processor_info; > > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > uint8_t reserved[8]; > fwts_acpi_cpep_processor_info cpep_info[0]; > } __attribute__ ((packed)) fwts_acpi_table_cpep; > > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > fwts_acpi_gas ec_control; > fwts_acpi_gas ec_data; > uint32_t uid; > @@ -175,7 +175,7 @@ typedef struct { > * From ACPI Spec, section 5.2.9 Fixed ACPI Description Field > */ > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > uint32_t firmware_control; > uint32_t dsdt; > uint8_t reserved; > @@ -393,14 +393,14 @@ typedef struct { > > /* Type 3, FWTS_ACPI_MADT_NMI_SOURCE */ > typedef struct { > - uint16_t flags; > + uint16_t flags; > uint32_t gsi; > } __attribute__ ((packed)) fwts_acpi_madt_nmi; > > /* Type 4, FWTS_ACPI_MADT_LOCAL_APIC_NMI */ > typedef struct { > uint8_t acpi_processor_id; > - uint16_t flags; > + uint16_t flags; > uint8_t local_apic_lint; > } __attribute__ ((packed)) fwts_acpi_madt_local_apic_nmi; > > @@ -812,7 +812,7 @@ typedef struct { > > /* Section 14.1, Platform Communications Channel Table */ > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > uint32_t flags; > uint8_t reserved[8]; > } __attribute__ ((packed)) fwts_acpi_table_pcct; > Acked-by: Colin Ian King <colin.king@canonical.com>
On 2015年07月16日 12:01, Alex Hung wrote: > Signed-off-by: Alex Hung <alex.hung@canonical.com> > --- > src/acpi/acpidump/acpidump.c | 36 ++++++++++++++++++------------------ > src/acpi/checksum/checksum.c | 4 ++-- > src/acpi/cstates/cstates.c | 2 +- > src/acpi/fan/fan.c | 4 ++-- > src/acpi/method/method.c | 4 ++-- > src/acpi/s3power/s3power.c | 2 +- > src/acpi/xenv/xenv.c | 1 - > src/lib/include/fwts_acpi.h | 16 ++++++++-------- > 8 files changed, 34 insertions(+), 35 deletions(-) > > diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c > index c55956c..e1f2513 100644 > --- a/src/acpi/acpidump/acpidump.c > +++ b/src/acpi/acpidump/acpidump.c > @@ -137,7 +137,7 @@ static uint64_t apci_dump_get_uint64_t( > case 8: > memcpy(&ret, data, info->size); > break; > - default: > + default: > ret = 0; > ptr = (uint8_t *)data; > for (i = 0; (i < info->size) && (i < 8); i++) { > @@ -174,7 +174,7 @@ static void acpi_dump_uint( > acpi_dump_field_info(info->label, info->size, info->offset + offset), > hexdigits, hexdigits, val); > break; > - default: > + default: > ptr = (uint8_t *)data; > for (i = 0; i < info->size; i++) { > uint8_t val8 = *ptr++; > @@ -305,7 +305,7 @@ static char *acpi_dump_gas_address_space_id(const uint64_t index) > char *txt; > > switch (index) { > - case 0x00: > + case 0x00: > txt = "System Memory"; > break; > case 0x01: > @@ -334,7 +334,7 @@ static char *acpi_dump_gas_address_space_id(const uint64_t index) > txt = "Unknown"; > break; > } > - > + > return txt; > } > > @@ -343,7 +343,7 @@ static void acpi_dump_gas( > const fwts_acpidump_field *info, > const void *data, > const int offset) > -{ > +{ > static const char *access_width[] = { > "Undefined (legacy reasons)", > "Byte Access", > @@ -367,7 +367,7 @@ static void acpi_dump_gas( > fwts_log_nl(fw); > fwts_log_info_verbatum(fw, "%s (Generic Address Structure)", > acpi_dump_field_info(info->label, info->size, offset + info->offset)); > - > + > __acpi_dump_table_fields(fw, data, fields, offset + info->offset); > } > > @@ -430,7 +430,7 @@ static void acpidump_boot(fwts_framework *fw, const fwts_acpi_table_info *table) > fwts_log_info_verbatum(fw, "%56.56s: %x", "Parity", (cmos_data & FWTS_BOOT_REGISTER_PARITY) ? 1 : 0); > } else > fwts_log_error(fw, "Cannot get read/write permission on I/O ports."); > - > + > } > > static void acpidump_bert(fwts_framework *fw, const fwts_acpi_table_info *table) > @@ -491,7 +491,7 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) > "BEGIN_READ_OPERATION", > "BEGIN_CLEAR_OPERATION", > "END_OPERATION", > - > + > "SET_RECORD_offsetof", > "EXECUTE_OPERATION", > "CHECK_BUSY_STATUS", > @@ -499,9 +499,9 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) > > "GET_RECORD_IDENTIFIER", > "SET_RECORD_IDENTIFIER", > - "GET_RECOERD_COUNT", > + "GET_RECOERD_COUNT", > "BEGIN_DUMMY_WRITE_OPERATION", > - > + > "RESERVED", > "GET_ERROR_LOG_ADDRESS_RANGE", > "GET_ERROR_LOG_ADDRESS_RANGE_LENGTH", > @@ -517,8 +517,8 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) > "NOOP", > "LOAD_VAR1", > "LOAD_VAR2", > - "STORE_VAR1", > - > + "STORE_VAR1", > + > "ADD", > "SUBTRACT", > "ADD_VALUE", > @@ -543,7 +543,7 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) > }; > > acpi_dump_table_fields(fw, table->data, fields, 0, table->length); > - > + > for (i = 0; i < erst->instruction_entry_count; i++) { > fwts_acpidump_field entry_fields[] = { > FIELD_STRS(" Action", fwts_acpi_table_erst, entries[i].serialization_action, serialization_actions, 16), > @@ -770,7 +770,7 @@ static void acpidump_madt(fwts_framework *fw, const fwts_acpi_table_info *table) > uint8_t *data = (uint8_t *)table->data; > size_t offset = 0; > int i = 0; > - > + > static const fwts_acpidump_field fields[] = { > FIELD_UINT("Local APIC Address", fwts_acpi_table_madt, lapic_address), > FIELD_UINT("Flags", fwts_acpi_table_madt, flags), > @@ -801,9 +801,9 @@ static void acpidump_madt(fwts_framework *fw, const fwts_acpi_table_info *table) > }; > > acpi_dump_table_fields(fw, data, fields, 0, table->length); > - > + > offset += sizeof(fwts_acpi_table_madt); > - data += sizeof(fwts_acpi_table_madt); > + data += sizeof(fwts_acpi_table_madt); > > > while (offset < table->length) { > @@ -1837,11 +1837,11 @@ static void acpidump_pcct(fwts_framework *fw, const fwts_acpi_table_info *table) > > /* Currently just type 0 is supported */ > switch (header->type) { > - case 0: > + case 0: > fwts_log_info_verbatum(fw, > "General Communications Subspace Structure (type 0):"); > __acpi_dump_table_fields(fw, ptr, type0_fields, ptr - data); > - > + > break; > default: > break; > diff --git a/src/acpi/checksum/checksum.c b/src/acpi/checksum/checksum.c > index a649231..68b23d1 100644 > --- a/src/acpi/checksum/checksum.c > +++ b/src/acpi/checksum/checksum.c > @@ -57,7 +57,7 @@ static void checksum_rsdp(fwts_framework *fw, fwts_acpi_table_info *table) > fwts_passed(fw, "Table RSDP has correct checksum 0x%2.2" PRIx8 ".", > rsdp->checksum); > > - /* > + /* > * Version 2.0 RSP or more. Note ACPI 1.0 is indicated by a > * zero version number > */ > @@ -80,7 +80,7 @@ static void checksum_rsdp(fwts_framework *fw, fwts_acpi_table_info *table) > "expected 0x%2.2" PRIx8 ", got 0x%2.2" PRIx8 ".", > (uint8_t)(rsdp->extended_checksum-checksum), > rsdp->extended_checksum); > - fwts_advice(fw, > + fwts_advice(fw, > "The kernel will not load the RSDP with an " > "invalid extended checksum and hence all " > "other ACPI tables will also fail to load."); > diff --git a/src/acpi/cstates/cstates.c b/src/acpi/cstates/cstates.c > index 1e9e00f..4bced4d 100644 > --- a/src/acpi/cstates/cstates.c > +++ b/src/acpi/cstates/cstates.c > @@ -86,7 +86,7 @@ static void get_cstates(char *path, fwts_cstates *state) > nr = 0; > else { > char *ptr = strstr(data, "-C"); > - if (ptr) > + if (ptr) > nr = strtol(ptr + 2, NULL, 10); > else > nr = 0; > diff --git a/src/acpi/fan/fan.c b/src/acpi/fan/fan.c > index 807989f..8da197f 100644 > --- a/src/acpi/fan/fan.c > +++ b/src/acpi/fan/fan.c > @@ -122,7 +122,7 @@ static fwts_list *get_fan_info(fwts_framework *fw) > } while (entry); > > closedir(dir); > - > + > return fans; > } > > @@ -243,7 +243,7 @@ static int fan_test2(fwts_framework *fw) > "to the driver and/or the fan speed is automatically being " > "controlled by firmware using System Management Mode in which case " > "the kernel interfaces being examined may not work anyway."); > - > + > > } > > diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c > index cd2baa4..e93a644 100644 > --- a/src/acpi/method/method.c > +++ b/src/acpi/method/method.c > @@ -2911,7 +2911,7 @@ static void method_test_CPC_return( > { ACPI_TYPE_BUFFER, "Maximum Performance Register" }, > { ACPI_TYPE_BUFFER, "Performance Reduction Tolerance Register" }, > { ACPI_TYPE_BUFFER, "Timed Window Register" }, > - { ACPI_TYPE_INTBUF, "Counter Wraparound Time" }, > + { ACPI_TYPE_INTBUF, "Counter Wraparound Time" }, > { ACPI_TYPE_BUFFER, "Nominal Counter Register" }, > { ACPI_TYPE_BUFFER, "Delivered Counter Register" }, > { ACPI_TYPE_BUFFER, "Performance Limited Register" }, > @@ -4876,7 +4876,7 @@ static int method_test_PIF(fwts_framework *fw) > } > > /* > - * Section 10.4 Power Meters > + * Section 10.4 Power Meters > */ > > static int method_test_GAI(fwts_framework *fw) > diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c > index dfe5b93..ba5f1bb 100644 > --- a/src/acpi/s3power/s3power.c > +++ b/src/acpi/s3power/s3power.c > @@ -50,7 +50,7 @@ static int s3power_adapter_offline(fwts_framework *fw, bool *offline) > /* Any online, then we're not totally offlined */ > > *offline = matching > 0 ? false : true; > - > + > return FWTS_OK; > } > > diff --git a/src/acpi/xenv/xenv.c b/src/acpi/xenv/xenv.c > index db8379a..c56e048 100644 > --- a/src/acpi/xenv/xenv.c > +++ b/src/acpi/xenv/xenv.c > @@ -97,4 +97,3 @@ static fwts_framework_ops xenv_check_ops = { > > FWTS_REGISTER("xenv", &xenv_check_ops, FWTS_TEST_ANYTIME, > FWTS_FLAG_BATCH | FWTS_FLAG_TEST_ACPI) > - > diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h > index 65d5e12..c113dd1 100644 > --- a/src/lib/include/fwts_acpi.h > +++ b/src/lib/include/fwts_acpi.h > @@ -78,13 +78,13 @@ typedef struct { > } __attribute__ ((packed)) fwts_acpi_table_header; > > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > uint8_t cmos_index; > uint8_t reserved[3]; > } __attribute__ ((packed)) fwts_acpi_table_boot; > > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > uint32_t boot_error_region_length; > uint64_t boot_error_region; > } __attribute__ ((packed)) fwts_acpi_table_bert; > @@ -107,13 +107,13 @@ typedef struct { > } __attribute__ ((packed)) fwts_acpi_cpep_processor_info; > > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > uint8_t reserved[8]; > fwts_acpi_cpep_processor_info cpep_info[0]; > } __attribute__ ((packed)) fwts_acpi_table_cpep; > > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > fwts_acpi_gas ec_control; > fwts_acpi_gas ec_data; > uint32_t uid; > @@ -175,7 +175,7 @@ typedef struct { > * From ACPI Spec, section 5.2.9 Fixed ACPI Description Field > */ > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > uint32_t firmware_control; > uint32_t dsdt; > uint8_t reserved; > @@ -393,14 +393,14 @@ typedef struct { > > /* Type 3, FWTS_ACPI_MADT_NMI_SOURCE */ > typedef struct { > - uint16_t flags; > + uint16_t flags; > uint32_t gsi; > } __attribute__ ((packed)) fwts_acpi_madt_nmi; > > /* Type 4, FWTS_ACPI_MADT_LOCAL_APIC_NMI */ > typedef struct { > uint8_t acpi_processor_id; > - uint16_t flags; > + uint16_t flags; > uint8_t local_apic_lint; > } __attribute__ ((packed)) fwts_acpi_madt_local_apic_nmi; > > @@ -812,7 +812,7 @@ typedef struct { > > /* Section 14.1, Platform Communications Channel Table */ > typedef struct { > - fwts_acpi_table_header header; > + fwts_acpi_table_header header; > uint32_t flags; > uint8_t reserved[8]; > } __attribute__ ((packed)) fwts_acpi_table_pcct; Acked-by: Ivan Hu<ivan.hu@canonical.com>
diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c index c55956c..e1f2513 100644 --- a/src/acpi/acpidump/acpidump.c +++ b/src/acpi/acpidump/acpidump.c @@ -137,7 +137,7 @@ static uint64_t apci_dump_get_uint64_t( case 8: memcpy(&ret, data, info->size); break; - default: + default: ret = 0; ptr = (uint8_t *)data; for (i = 0; (i < info->size) && (i < 8); i++) { @@ -174,7 +174,7 @@ static void acpi_dump_uint( acpi_dump_field_info(info->label, info->size, info->offset + offset), hexdigits, hexdigits, val); break; - default: + default: ptr = (uint8_t *)data; for (i = 0; i < info->size; i++) { uint8_t val8 = *ptr++; @@ -305,7 +305,7 @@ static char *acpi_dump_gas_address_space_id(const uint64_t index) char *txt; switch (index) { - case 0x00: + case 0x00: txt = "System Memory"; break; case 0x01: @@ -334,7 +334,7 @@ static char *acpi_dump_gas_address_space_id(const uint64_t index) txt = "Unknown"; break; } - + return txt; } @@ -343,7 +343,7 @@ static void acpi_dump_gas( const fwts_acpidump_field *info, const void *data, const int offset) -{ +{ static const char *access_width[] = { "Undefined (legacy reasons)", "Byte Access", @@ -367,7 +367,7 @@ static void acpi_dump_gas( fwts_log_nl(fw); fwts_log_info_verbatum(fw, "%s (Generic Address Structure)", acpi_dump_field_info(info->label, info->size, offset + info->offset)); - + __acpi_dump_table_fields(fw, data, fields, offset + info->offset); } @@ -430,7 +430,7 @@ static void acpidump_boot(fwts_framework *fw, const fwts_acpi_table_info *table) fwts_log_info_verbatum(fw, "%56.56s: %x", "Parity", (cmos_data & FWTS_BOOT_REGISTER_PARITY) ? 1 : 0); } else fwts_log_error(fw, "Cannot get read/write permission on I/O ports."); - + } static void acpidump_bert(fwts_framework *fw, const fwts_acpi_table_info *table) @@ -491,7 +491,7 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) "BEGIN_READ_OPERATION", "BEGIN_CLEAR_OPERATION", "END_OPERATION", - + "SET_RECORD_offsetof", "EXECUTE_OPERATION", "CHECK_BUSY_STATUS", @@ -499,9 +499,9 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) "GET_RECORD_IDENTIFIER", "SET_RECORD_IDENTIFIER", - "GET_RECOERD_COUNT", + "GET_RECOERD_COUNT", "BEGIN_DUMMY_WRITE_OPERATION", - + "RESERVED", "GET_ERROR_LOG_ADDRESS_RANGE", "GET_ERROR_LOG_ADDRESS_RANGE_LENGTH", @@ -517,8 +517,8 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) "NOOP", "LOAD_VAR1", "LOAD_VAR2", - "STORE_VAR1", - + "STORE_VAR1", + "ADD", "SUBTRACT", "ADD_VALUE", @@ -543,7 +543,7 @@ static void acpidump_erst(fwts_framework *fw, const fwts_acpi_table_info *table) }; acpi_dump_table_fields(fw, table->data, fields, 0, table->length); - + for (i = 0; i < erst->instruction_entry_count; i++) { fwts_acpidump_field entry_fields[] = { FIELD_STRS(" Action", fwts_acpi_table_erst, entries[i].serialization_action, serialization_actions, 16), @@ -770,7 +770,7 @@ static void acpidump_madt(fwts_framework *fw, const fwts_acpi_table_info *table) uint8_t *data = (uint8_t *)table->data; size_t offset = 0; int i = 0; - + static const fwts_acpidump_field fields[] = { FIELD_UINT("Local APIC Address", fwts_acpi_table_madt, lapic_address), FIELD_UINT("Flags", fwts_acpi_table_madt, flags), @@ -801,9 +801,9 @@ static void acpidump_madt(fwts_framework *fw, const fwts_acpi_table_info *table) }; acpi_dump_table_fields(fw, data, fields, 0, table->length); - + offset += sizeof(fwts_acpi_table_madt); - data += sizeof(fwts_acpi_table_madt); + data += sizeof(fwts_acpi_table_madt); while (offset < table->length) { @@ -1837,11 +1837,11 @@ static void acpidump_pcct(fwts_framework *fw, const fwts_acpi_table_info *table) /* Currently just type 0 is supported */ switch (header->type) { - case 0: + case 0: fwts_log_info_verbatum(fw, "General Communications Subspace Structure (type 0):"); __acpi_dump_table_fields(fw, ptr, type0_fields, ptr - data); - + break; default: break; diff --git a/src/acpi/checksum/checksum.c b/src/acpi/checksum/checksum.c index a649231..68b23d1 100644 --- a/src/acpi/checksum/checksum.c +++ b/src/acpi/checksum/checksum.c @@ -57,7 +57,7 @@ static void checksum_rsdp(fwts_framework *fw, fwts_acpi_table_info *table) fwts_passed(fw, "Table RSDP has correct checksum 0x%2.2" PRIx8 ".", rsdp->checksum); - /* + /* * Version 2.0 RSP or more. Note ACPI 1.0 is indicated by a * zero version number */ @@ -80,7 +80,7 @@ static void checksum_rsdp(fwts_framework *fw, fwts_acpi_table_info *table) "expected 0x%2.2" PRIx8 ", got 0x%2.2" PRIx8 ".", (uint8_t)(rsdp->extended_checksum-checksum), rsdp->extended_checksum); - fwts_advice(fw, + fwts_advice(fw, "The kernel will not load the RSDP with an " "invalid extended checksum and hence all " "other ACPI tables will also fail to load."); diff --git a/src/acpi/cstates/cstates.c b/src/acpi/cstates/cstates.c index 1e9e00f..4bced4d 100644 --- a/src/acpi/cstates/cstates.c +++ b/src/acpi/cstates/cstates.c @@ -86,7 +86,7 @@ static void get_cstates(char *path, fwts_cstates *state) nr = 0; else { char *ptr = strstr(data, "-C"); - if (ptr) + if (ptr) nr = strtol(ptr + 2, NULL, 10); else nr = 0; diff --git a/src/acpi/fan/fan.c b/src/acpi/fan/fan.c index 807989f..8da197f 100644 --- a/src/acpi/fan/fan.c +++ b/src/acpi/fan/fan.c @@ -122,7 +122,7 @@ static fwts_list *get_fan_info(fwts_framework *fw) } while (entry); closedir(dir); - + return fans; } @@ -243,7 +243,7 @@ static int fan_test2(fwts_framework *fw) "to the driver and/or the fan speed is automatically being " "controlled by firmware using System Management Mode in which case " "the kernel interfaces being examined may not work anyway."); - + } diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c index cd2baa4..e93a644 100644 --- a/src/acpi/method/method.c +++ b/src/acpi/method/method.c @@ -2911,7 +2911,7 @@ static void method_test_CPC_return( { ACPI_TYPE_BUFFER, "Maximum Performance Register" }, { ACPI_TYPE_BUFFER, "Performance Reduction Tolerance Register" }, { ACPI_TYPE_BUFFER, "Timed Window Register" }, - { ACPI_TYPE_INTBUF, "Counter Wraparound Time" }, + { ACPI_TYPE_INTBUF, "Counter Wraparound Time" }, { ACPI_TYPE_BUFFER, "Nominal Counter Register" }, { ACPI_TYPE_BUFFER, "Delivered Counter Register" }, { ACPI_TYPE_BUFFER, "Performance Limited Register" }, @@ -4876,7 +4876,7 @@ static int method_test_PIF(fwts_framework *fw) } /* - * Section 10.4 Power Meters + * Section 10.4 Power Meters */ static int method_test_GAI(fwts_framework *fw) diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c index dfe5b93..ba5f1bb 100644 --- a/src/acpi/s3power/s3power.c +++ b/src/acpi/s3power/s3power.c @@ -50,7 +50,7 @@ static int s3power_adapter_offline(fwts_framework *fw, bool *offline) /* Any online, then we're not totally offlined */ *offline = matching > 0 ? false : true; - + return FWTS_OK; } diff --git a/src/acpi/xenv/xenv.c b/src/acpi/xenv/xenv.c index db8379a..c56e048 100644 --- a/src/acpi/xenv/xenv.c +++ b/src/acpi/xenv/xenv.c @@ -97,4 +97,3 @@ static fwts_framework_ops xenv_check_ops = { FWTS_REGISTER("xenv", &xenv_check_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_TEST_ACPI) - diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h index 65d5e12..c113dd1 100644 --- a/src/lib/include/fwts_acpi.h +++ b/src/lib/include/fwts_acpi.h @@ -78,13 +78,13 @@ typedef struct { } __attribute__ ((packed)) fwts_acpi_table_header; typedef struct { - fwts_acpi_table_header header; + fwts_acpi_table_header header; uint8_t cmos_index; uint8_t reserved[3]; } __attribute__ ((packed)) fwts_acpi_table_boot; typedef struct { - fwts_acpi_table_header header; + fwts_acpi_table_header header; uint32_t boot_error_region_length; uint64_t boot_error_region; } __attribute__ ((packed)) fwts_acpi_table_bert; @@ -107,13 +107,13 @@ typedef struct { } __attribute__ ((packed)) fwts_acpi_cpep_processor_info; typedef struct { - fwts_acpi_table_header header; + fwts_acpi_table_header header; uint8_t reserved[8]; fwts_acpi_cpep_processor_info cpep_info[0]; } __attribute__ ((packed)) fwts_acpi_table_cpep; typedef struct { - fwts_acpi_table_header header; + fwts_acpi_table_header header; fwts_acpi_gas ec_control; fwts_acpi_gas ec_data; uint32_t uid; @@ -175,7 +175,7 @@ typedef struct { * From ACPI Spec, section 5.2.9 Fixed ACPI Description Field */ typedef struct { - fwts_acpi_table_header header; + fwts_acpi_table_header header; uint32_t firmware_control; uint32_t dsdt; uint8_t reserved; @@ -393,14 +393,14 @@ typedef struct { /* Type 3, FWTS_ACPI_MADT_NMI_SOURCE */ typedef struct { - uint16_t flags; + uint16_t flags; uint32_t gsi; } __attribute__ ((packed)) fwts_acpi_madt_nmi; /* Type 4, FWTS_ACPI_MADT_LOCAL_APIC_NMI */ typedef struct { uint8_t acpi_processor_id; - uint16_t flags; + uint16_t flags; uint8_t local_apic_lint; } __attribute__ ((packed)) fwts_acpi_madt_local_apic_nmi; @@ -812,7 +812,7 @@ typedef struct { /* Section 14.1, Platform Communications Channel Table */ typedef struct { - fwts_acpi_table_header header; + fwts_acpi_table_header header; uint32_t flags; uint8_t reserved[8]; } __attribute__ ((packed)) fwts_acpi_table_pcct;
Signed-off-by: Alex Hung <alex.hung@canonical.com> --- src/acpi/acpidump/acpidump.c | 36 ++++++++++++++++++------------------ src/acpi/checksum/checksum.c | 4 ++-- src/acpi/cstates/cstates.c | 2 +- src/acpi/fan/fan.c | 4 ++-- src/acpi/method/method.c | 4 ++-- src/acpi/s3power/s3power.c | 2 +- src/acpi/xenv/xenv.c | 1 - src/lib/include/fwts_acpi.h | 16 ++++++++-------- 8 files changed, 34 insertions(+), 35 deletions(-)