Cleanup the ACPI_NEXT_RESOURCE macro. Update AcpiWalkResources to use ACPI_NEXT_RESOURCE. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@xxxxxxxxx> Signed-off-by: Bob Moore <robert.moore@xxxxxxxxx> --- drivers/acpi/acpica/rsxface.c | 4 +--- include/acpi/acrestyp.h | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c index 5aad744..3a5ace7 100644 --- a/drivers/acpi/acpica/rsxface.c +++ b/drivers/acpi/acpica/rsxface.c @@ -606,9 +606,7 @@ acpi_walk_resources(acpi_handle device_handle, /* Get the next resource descriptor */ - resource = - ACPI_ADD_PTR(struct acpi_resource, resource, - resource->length); + resource = ACPI_NEXT_RESOURCE(resource); } ACPI_FREE(buffer.pointer); diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h index 40349ae..17f2d05 100644 --- a/include/acpi/acrestyp.h +++ b/include/acpi/acrestyp.h @@ -591,7 +591,10 @@ struct acpi_resource { #define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12) #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) -#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) +/* Macro for walking resource templates with multiple descriptors */ + +#define ACPI_NEXT_RESOURCE(res) \ + ACPI_ADD_PTR (struct acpi_resource, (res), (res)->length) struct acpi_pci_routing_table { u32 length; -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html