summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-04-08 15:23:06 -0600
committerTom Rini <[email protected]>2025-04-08 16:23:27 -0600
commitfba8bfdd0bf2db1edd0383ba89a0c6037a6fe807 (patch)
treee6389f796e17959417c99a9ca196d373ffec4c94 /board
parenta1dd42950dee5e0da8fb5e053d8506eaa4000bf4 (diff)
parentfecc50b0517d362b4db173b08a769f7b975d8255 (diff)
Merge patch series "acpi: simplify updating ACPI table header checksum"
Heinrich Schuchardt <[email protected]> says: Introduce a new function to update ACPI table headers. This allows to simplify the existing code. Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'board')
-rw-r--r--board/emulation/qemu-sbsa/acpi.c4
-rw-r--r--board/raspberrypi/rpi/rpi.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/board/emulation/qemu-sbsa/acpi.c b/board/emulation/qemu-sbsa/acpi.c
index 2e518f2f03f..806780947bd 100644
--- a/board/emulation/qemu-sbsa/acpi.c
+++ b/board/emulation/qemu-sbsa/acpi.c
@@ -138,7 +138,7 @@ static int sbsa_write_gtdt(struct acpi_ctx *ctx, const struct acpi_writer *entry
gtdt->cnt_read_base = 0xffffffffffffffff;
// FIXME: VirtualPL2Timer
- header->checksum = table_compute_checksum(header, header->length);
+ acpi_update_checksum(header);
acpi_add_table(ctx, gtdt);
@@ -186,7 +186,7 @@ static int acpi_write_pptt(struct acpi_ctx *ctx, const struct acpi_writer *entry
}
header->length = ctx->current - ctx->tab_start;
- header->checksum = table_compute_checksum(header, header->length);
+ acpi_update_checksum(header);
acpi_inc(ctx, header->length);
acpi_add_table(ctx, header);
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 70d3c35499b..6ecd3eb120f 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -791,7 +791,7 @@ static int rpi_acpi_write_ssdt(struct acpi_ctx *ctx, const struct acpi_writer *e
/* (Re)calculate length and checksum */
ssdt->length = ctx->current - (void *)ssdt;
- ssdt->checksum = table_compute_checksum((void *)ssdt, ssdt->length);
+ acpi_update_checksum(ssdt);
log_debug("SSDT at %p, length %x\n", ssdt, ssdt->length);
/* Drop the table if it is empty */