From 383a06ef8d567adb53f9c7031d711fcec32e7d0d Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 9 Feb 2023 16:25:38 +0100 Subject: acpi/acpigen: use acpigen_write_if_lgreater_* in acpigen_write_rom Use existing functions instead of open-coding the same functionality. Signed-off-by: Felix Held Change-Id: I660bd5d357eb86c19a5a7847925f6176c3fb4425 Reviewed-on: https://review.coreboot.org/c/coreboot/+/72935 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak Reviewed-by: Elyes Haouas --- src/acpi/acpigen.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/acpi') diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index 63953b86b1..8eea91c5f4 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -2015,10 +2015,7 @@ void acpigen_write_rom(void *bios, const size_t length) /* ACPI SPEC requires to return at maximum 4KiB */ /* If (LGreater (Local1, 0x1000)) */ - acpigen_write_if(); - acpigen_emit_byte(LGREATER_OP); - acpigen_emit_byte(LOCAL1_OP); - acpigen_write_integer(0x1000); + acpigen_write_if_lgreater_op_int(LOCAL1_OP, 0x1000); /* Store (0x1000, Local1) */ acpigen_write_store(); @@ -2034,10 +2031,7 @@ void acpigen_write_rom(void *bios, const size_t length) acpigen_emit_byte(LOCAL3_OP); /* If (LGreater (Local0, length)) */ - acpigen_write_if(); - acpigen_emit_byte(LGREATER_OP); - acpigen_emit_byte(LOCAL0_OP); - acpigen_write_integer(length); + acpigen_write_if_lgreater_op_int(LOCAL0_OP, length); /* Return(Buffer(Local1){0}) */ acpigen_emit_byte(RETURN_OP); @@ -2051,10 +2045,7 @@ void acpigen_write_rom(void *bios, const size_t length) acpigen_pop_len(); /* If (LGreater (Local0, length - 4096)) */ - acpigen_write_if(); - acpigen_emit_byte(LGREATER_OP); - acpigen_emit_byte(LOCAL0_OP); - acpigen_write_integer(length - 4096); + acpigen_write_if_lgreater_op_int(LOCAL0_OP, length - 4096); /* Subtract (length, Local0, Local2) */ acpigen_emit_byte(SUBTRACT_OP); @@ -2063,10 +2054,7 @@ void acpigen_write_rom(void *bios, const size_t length) acpigen_emit_byte(LOCAL2_OP); /* If (LGreater (Local1, Local2)) */ - acpigen_write_if(); - acpigen_emit_byte(LGREATER_OP); - acpigen_emit_byte(LOCAL1_OP); - acpigen_emit_byte(LOCAL2_OP); + acpigen_write_if_lgreater_op_op(LOCAL1_OP, LOCAL2_OP); /* Store (Local2, Local1) */ acpigen_write_store(); -- cgit v1.2.3