Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46257 )
Change subject: acpigen: Make gpio set/get arguments const ......................................................................
acpigen: Make gpio set/get arguments const
The 'struct acpi_gpio' arguments passed to acpigen functions are not modified so they can be made const, which allows drivers to also use a const pointer.
Signed-off-by: Duncan Laurie dlaurie@google.com Change-Id: I59e9c19e7bfdca275230776497767ddc7f6c52db --- M src/acpi/acpigen.c M src/include/acpi/acpigen.h 2 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/46257/1
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index 0ed3708..e2fe2cf 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -1865,7 +1865,7 @@ * * Returns 0 on success and -1 on error. */ -int acpigen_enable_tx_gpio(struct acpi_gpio *gpio) +int acpigen_enable_tx_gpio(const struct acpi_gpio *gpio) { if (gpio->active_low) return acpigen_soc_clear_tx_gpio(gpio->pins[0]); @@ -1873,7 +1873,7 @@ return acpigen_soc_set_tx_gpio(gpio->pins[0]); }
-int acpigen_disable_tx_gpio(struct acpi_gpio *gpio) +int acpigen_disable_tx_gpio(const struct acpi_gpio *gpio) { if (gpio->active_low) return acpigen_soc_set_tx_gpio(gpio->pins[0]); @@ -1881,7 +1881,7 @@ return acpigen_soc_clear_tx_gpio(gpio->pins[0]); }
-void acpigen_get_rx_gpio(struct acpi_gpio *gpio) +void acpigen_get_rx_gpio(const struct acpi_gpio *gpio) { acpigen_soc_read_rx_gpio(gpio->pins[0]);
@@ -1889,7 +1889,7 @@ acpigen_write_xor(LOCAL0_OP, 1, LOCAL0_OP); }
-void acpigen_get_tx_gpio(struct acpi_gpio *gpio) +void acpigen_get_tx_gpio(const struct acpi_gpio *gpio) { acpigen_soc_get_tx_gpio(gpio->pins[0]);
diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h index cb9e9c9..e0d95cd 100644 --- a/src/include/acpi/acpigen.h +++ b/src/include/acpi/acpigen.h @@ -499,8 +499,8 @@ * * Returns 0 on success and -1 on error. */ -int acpigen_enable_tx_gpio(struct acpi_gpio *gpio); -int acpigen_disable_tx_gpio(struct acpi_gpio *gpio); +int acpigen_enable_tx_gpio(const struct acpi_gpio *gpio); +int acpigen_disable_tx_gpio(const struct acpi_gpio *gpio);
/* * Helper function for getting a RX GPIO value based on the GPIO polarity. @@ -508,7 +508,7 @@ * This function ends up calling acpigen_soc_get_rx_gpio to make callbacks * into SoC acpigen code */ -void acpigen_get_rx_gpio(struct acpi_gpio *gpio); +void acpigen_get_rx_gpio(const struct acpi_gpio *gpio);
/* * Helper function for getting a TX GPIO value based on the GPIO polarity. @@ -516,7 +516,7 @@ * This function ends up calling acpigen_soc_get_tx_gpio to make callbacks * into SoC acpigen code */ -void acpigen_get_tx_gpio(struct acpi_gpio *gpio); +void acpigen_get_tx_gpio(const struct acpi_gpio *gpio);
/* refer to ACPI 6.4.3.5.3 Word Address Space Descriptor section for details */ void acpigen_resource_word(u16 res_type, u16 gen_flags, u16 type_flags, u16 gran,
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46257 )
Change subject: acpigen: Make gpio set/get arguments const ......................................................................
Patch Set 2: Code-Review+2
Duncan Laurie has submitted this change. ( https://review.coreboot.org/c/coreboot/+/46257 )
Change subject: acpigen: Make gpio set/get arguments const ......................................................................
acpigen: Make gpio set/get arguments const
The 'struct acpi_gpio' arguments passed to acpigen functions are not modified so they can be made const, which allows drivers to also use a const pointer.
Signed-off-by: Duncan Laurie dlaurie@google.com Change-Id: I59e9c19e7bfdca275230776497767ddc7f6c52db Reviewed-on: https://review.coreboot.org/c/coreboot/+/46257 Reviewed-by: Furquan Shaikh furquan@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/acpi/acpigen.c M src/include/acpi/acpigen.h 2 files changed, 8 insertions(+), 8 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index 0ed3708..e2fe2cf 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -1865,7 +1865,7 @@ * * Returns 0 on success and -1 on error. */ -int acpigen_enable_tx_gpio(struct acpi_gpio *gpio) +int acpigen_enable_tx_gpio(const struct acpi_gpio *gpio) { if (gpio->active_low) return acpigen_soc_clear_tx_gpio(gpio->pins[0]); @@ -1873,7 +1873,7 @@ return acpigen_soc_set_tx_gpio(gpio->pins[0]); }
-int acpigen_disable_tx_gpio(struct acpi_gpio *gpio) +int acpigen_disable_tx_gpio(const struct acpi_gpio *gpio) { if (gpio->active_low) return acpigen_soc_set_tx_gpio(gpio->pins[0]); @@ -1881,7 +1881,7 @@ return acpigen_soc_clear_tx_gpio(gpio->pins[0]); }
-void acpigen_get_rx_gpio(struct acpi_gpio *gpio) +void acpigen_get_rx_gpio(const struct acpi_gpio *gpio) { acpigen_soc_read_rx_gpio(gpio->pins[0]);
@@ -1889,7 +1889,7 @@ acpigen_write_xor(LOCAL0_OP, 1, LOCAL0_OP); }
-void acpigen_get_tx_gpio(struct acpi_gpio *gpio) +void acpigen_get_tx_gpio(const struct acpi_gpio *gpio) { acpigen_soc_get_tx_gpio(gpio->pins[0]);
diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h index cb9e9c9..e0d95cd 100644 --- a/src/include/acpi/acpigen.h +++ b/src/include/acpi/acpigen.h @@ -499,8 +499,8 @@ * * Returns 0 on success and -1 on error. */ -int acpigen_enable_tx_gpio(struct acpi_gpio *gpio); -int acpigen_disable_tx_gpio(struct acpi_gpio *gpio); +int acpigen_enable_tx_gpio(const struct acpi_gpio *gpio); +int acpigen_disable_tx_gpio(const struct acpi_gpio *gpio);
/* * Helper function for getting a RX GPIO value based on the GPIO polarity. @@ -508,7 +508,7 @@ * This function ends up calling acpigen_soc_get_rx_gpio to make callbacks * into SoC acpigen code */ -void acpigen_get_rx_gpio(struct acpi_gpio *gpio); +void acpigen_get_rx_gpio(const struct acpi_gpio *gpio);
/* * Helper function for getting a TX GPIO value based on the GPIO polarity. @@ -516,7 +516,7 @@ * This function ends up calling acpigen_soc_get_tx_gpio to make callbacks * into SoC acpigen code */ -void acpigen_get_tx_gpio(struct acpi_gpio *gpio); +void acpigen_get_tx_gpio(const struct acpi_gpio *gpio);
/* refer to ACPI 6.4.3.5.3 Word Address Space Descriptor section for details */ void acpigen_resource_word(u16 res_type, u16 gen_flags, u16 type_flags, u16 gran,