aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorTang Chen <tangchen@cn.fujitsu.com>2013-08-14 05:37:08 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-14 17:24:01 -0400
commit7702ae0dd9b40930931914866999a2ac9734d3eb (patch)
tree2e9fc055c4b4ca5aa54408ebe1d69411d837c00d /drivers/acpi
parent598bae70c2a8e35c8d39b610cca2b32afcf047af (diff)
ACPI / osl: Kill macro INVALID_TABLE().
The macro INVALID_TABLE() is defined like this: #define INVALID_TABLE(x, path, name) \ { pr_err("ACPI OVERRIDE: " x " [%s%s]\n", path, name); continue; } And it is used like this: for (...) { ... if (...) INVALID_TABLE() ... } The "continue" in the macro makes the code hard to understand. And also, this macro is only used several times in a single file. As suggested by Joe Perches <joe@perches.com>, we can remote it and use pr_err directly. So after this patch, this macro is removed, and pr_err() is used like this: for (...) { ... if (...) { pr_err("ACPI OVERRIDE: ......"); continue; } ... } Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Suggested-by: Joe Perches <joe@perches.com> Acked-by: Tejun Heo <tj@kernel.org> Acked-by: Toshi Kani <toshi.kani@hp.com> Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/osl.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index eb95978854a3..6bc08272f050 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -564,10 +564,6 @@ static const char * const table_sigs[] = {
564 ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_PSDT, 564 ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_PSDT,
565 ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT, NULL }; 565 ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT, NULL };
566 566
567/* Non-fatal errors: Affected tables/files are ignored */
568#define INVALID_TABLE(x, path, name) \
569 { pr_err("ACPI OVERRIDE: " x " [%s%s]\n", path, name); continue; }
570
571#define ACPI_HEADER_SIZE sizeof(struct acpi_table_header) 567#define ACPI_HEADER_SIZE sizeof(struct acpi_table_header)
572 568
573/* Must not increase 10 or needs code modification below */ 569/* Must not increase 10 or needs code modification below */
@@ -594,9 +590,11 @@ void __init acpi_initrd_override(void *data, size_t size)
594 data += offset; 590 data += offset;
595 size -= offset; 591 size -= offset;
596 592
597 if (file.size < sizeof(struct acpi_table_header)) 593 if (file.size < sizeof(struct acpi_table_header)) {
598 INVALID_TABLE("Table smaller than ACPI header", 594 pr_err("ACPI OVERRIDE: Table smaller than ACPI header [%s%s]\n",
599 cpio_path, file.name); 595 cpio_path, file.name);
596 continue;
597 }
600 598
601 table = file.data; 599 table = file.data;
602 600
@@ -604,15 +602,21 @@ void __init acpi_initrd_override(void *data, size_t size)
604 if (!memcmp(table->signature, table_sigs[sig], 4)) 602 if (!memcmp(table->signature, table_sigs[sig], 4))
605 break; 603 break;
606 604
607 if (!table_sigs[sig]) 605 if (!table_sigs[sig]) {
608 INVALID_TABLE("Unknown signature", 606 pr_err("ACPI OVERRIDE: Unknown signature [%s%s]\n",
609 cpio_path, file.name); 607 cpio_path, file.name);
610 if (file.size != table->length) 608 continue;
611 INVALID_TABLE("File length does not match table length", 609 }
612 cpio_path, file.name); 610 if (file.size != table->length) {
613 if (acpi_table_checksum(file.data, table->length)) 611 pr_err("ACPI OVERRIDE: File length does not match table length [%s%s]\n",
614 INVALID_TABLE("Bad table checksum", 612 cpio_path, file.name);
615 cpio_path, file.name); 613 continue;
614 }
615 if (acpi_table_checksum(file.data, table->length)) {
616 pr_err("ACPI OVERRIDE: Bad table checksum [%s%s]\n",
617 cpio_path, file.name);
618 continue;
619 }
616 620
617 pr_info("%4.4s ACPI table found in initrd [%s%s][0x%x]\n", 621 pr_info("%4.4s ACPI table found in initrd [%s%s][0x%x]\n",
618 table->signature, cpio_path, file.name, table->length); 622 table->signature, cpio_path, file.name, table->length);