Hi Ashwin,
On 2014-3-20 7:09, Ashwin Chaugule wrote:
The acpi_table_parse() function has a callback that passes a pointer to a table_header. Add a new function which takes this pointer and parses its entries. This eliminates the need to re-traverse all the tables for each call. e.g. as in acpi_table_parse_madt() which is normally called after acpi_table_parse().
Signed-off-by: Ashwin Chaugule ashwin.chaugule@linaro.org
drivers/acpi/tables.c | 69 +++++++++++++++++++++++++++++++++++---------------- include/linux/acpi.h | 4 +++ 2 files changed, 51 insertions(+), 22 deletions(-)
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 5837f85..b7bd6a3 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -199,19 +199,15 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) } }
int __init -acpi_table_parse_entries(char *id,
unsigned long table_size,
int entry_id,
acpi_tbl_entry_handler handler,
unsigned int max_entries)
+acpi_parse_entries(unsigned long table_size,
acpi_tbl_entry_handler handler,
struct acpi_table_header *table_header,
int entry_id, unsigned int max_entries)
{
- struct acpi_table_header *table_header = NULL; struct acpi_subtable_header *entry; unsigned int count = 0; unsigned long table_end;
- acpi_size tbl_size;
if (acpi_disabled) return -ENODEV; @@ -219,16 +215,14 @@ acpi_table_parse_entries(char *id, if (!handler) return -EINVAL;
- if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
acpi_get_table_with_size(id, acpi_apic_instance, &table_header, &tbl_size);
- else
acpi_get_table_with_size(id, 0, &table_header, &tbl_size);
- if (!table_header) {
printk(KERN_WARNING PREFIX "%4.4s not present\n", id);
pr_warn(PREFIX "Table header not present\n");
Can you rebase this patch on the branch of linux-next of linux-pm tree? PREFIX was removed by me and I used pr_fmt() instead.
Thanks Hanjun