Skip to content

Commit

Permalink
Merge branch 'bugzilla-11539' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Len Brown committed Nov 12, 2008
2 parents 597e4fa + 4feba70 commit 50f19e3
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions drivers/acpi/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ static ssize_t acpi_table_show(struct kobject *kobj,
container_of(bin_attr, struct acpi_table_attr, attr);
struct acpi_table_header *table_header = NULL;
acpi_status status;
char name[ACPI_NAME_SIZE];

if (strncmp(table_attr->name, "NULL", 4))
memcpy(name, table_attr->name, ACPI_NAME_SIZE);
else
memcpy(name, "\0\0\0\0", 4);

status =
acpi_get_table(table_attr->name, table_attr->instance,
acpi_get_table(name, table_attr->instance,
&table_header);
if (ACPI_FAILURE(status))
return -ENODEV;
Expand All @@ -95,21 +101,24 @@ static void acpi_table_attr_init(struct acpi_table_attr *table_attr,
struct acpi_table_header *header = NULL;
struct acpi_table_attr *attr = NULL;

memcpy(table_attr->name, table_header->signature, ACPI_NAME_SIZE);
if (table_header->signature[0] != '\0')
memcpy(table_attr->name, table_header->signature,
ACPI_NAME_SIZE);
else
memcpy(table_attr->name, "NULL", 4);

list_for_each_entry(attr, &acpi_table_attr_list, node) {
if (!memcmp(table_header->signature, attr->name,
ACPI_NAME_SIZE))
if (!memcmp(table_attr->name, attr->name, ACPI_NAME_SIZE))
if (table_attr->instance < attr->instance)
table_attr->instance = attr->instance;
}
table_attr->instance++;

if (table_attr->instance > 1 || (table_attr->instance == 1 &&
!acpi_get_table(table_header->
signature, 2,
&header)))
sprintf(table_attr->name + 4, "%d", table_attr->instance);
!acpi_get_table
(table_header->signature, 2, &header)))
sprintf(table_attr->name + ACPI_NAME_SIZE, "%d",
table_attr->instance);

table_attr->attr.size = 0;
table_attr->attr.read = acpi_table_show;
Expand Down

0 comments on commit 50f19e3

Please sign in to comment.