Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94d4be67 authored by Lv Zheng's avatar Lv Zheng Committed by Rafael J. Wysocki
Browse files

ACPICA: Tables: Cleanup table checksum verification code.



This patch reduces code redundancy by moving the FACS/S3PT checksum
verification skip logic into acpi_tb_verify_checksum() and other
calls of this function also get benefit from this change.  Lv Zheng.

Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Reviewed-by: default avatarLen Brown <len.brown@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 424deb38
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -80,16 +80,10 @@ acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc)
		}
	}

	/* FACS is the odd table, has no standard ACPI header and no checksum */

	if (!ACPI_COMPARE_NAME(&table_desc->signature, ACPI_SIG_FACS)) {

	/* Always calculate checksum, ignore bad checksum if requested */

	status =
		    acpi_tb_verify_checksum(table_desc->pointer,
					    table_desc->length);
	}
	    acpi_tb_verify_checksum(table_desc->pointer, table_desc->length);

	return_ACPI_STATUS(status);
}
+10 −0
Original line number Diff line number Diff line
@@ -190,6 +190,16 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length)
{
	u8 checksum;

	/*
	 * FACS/S3PT:
	 * They are the odd tables, have no standard ACPI header and no checksum
	 */

	if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_S3PT) ||
	    ACPI_COMPARE_NAME(table->signature, ACPI_SIG_FACS)) {
		return (AE_OK);
	}

	/* Compute the checksum on the table */

	checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, table), length);