ACK: [PATCH 8/9] lib: fwts_acpi_tables: remove redundant store to xsdt

ivanhu ivan.hu at canonical.com
Wed Dec 16 06:50:22 UTC 2015



On 2015年12月16日 08:51, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Static analysis from clang scan-build found a redundant store
> to xsdt that can be removed. Also move scope of xsdt and rsdt.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/lib/src/fwts_acpi_tables.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
> index 573a8af..86b53a2 100644
> --- a/src/lib/src/fwts_acpi_tables.c
> +++ b/src/lib/src/fwts_acpi_tables.c
> @@ -916,8 +916,6 @@ static int fwts_acpi_load_tables_fixup(fwts_framework *fw)
>   	char *oem_tbl_id = "FWTSIDXX";
>   	fwts_acpi_table_info *table;
>   	fwts_acpi_table_rsdp *rsdp = NULL;
> -	fwts_acpi_table_rsdt *rsdt = NULL;
> -	fwts_acpi_table_xsdt *xsdt = NULL;
>   	fwts_acpi_table_fadt *fadt = NULL;
>   	uint64_t rsdt_fake_addr = 0, xsdt_fake_addr = 0;
>   	bool redo_rsdp_checksum = false;
> @@ -995,6 +993,8 @@ static int fwts_acpi_load_tables_fixup(fwts_framework *fw)
>   		rsdt_fake_addr = table->addr;
>   	} else {
>   		/* No RSDT? go and fake one */
> +
> +		fwts_acpi_table_rsdt *rsdt;
>   		size_t size = sizeof(fwts_acpi_table_rsdt) + (count * sizeof(uint32_t));
>
>   		if ((rsdt = fwts_low_calloc(1, size)) == NULL) {
> @@ -1027,10 +1027,11 @@ static int fwts_acpi_load_tables_fixup(fwts_framework *fw)
>   		return FWTS_ERROR;
>   	}
>   	if (table) {
> -		xsdt = (fwts_acpi_table_xsdt *)table->data;
>   		xsdt_fake_addr = table->addr;
>   	} else {
>   		/* No XSDT? go and fake one */
> +
> +		fwts_acpi_table_xsdt *xsdt;
>   		size_t size = sizeof(fwts_acpi_table_rsdt) + (count * sizeof(uint64_t));
>
>   		if ((xsdt = fwts_low_calloc(1, size)) == NULL) {
>

Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list