[PATCH v2] ACPI/IORT: Fix GCC 12 warning

David Laight David.Laight at ACULAB.COM
Sat Feb 12 18:20:27 PST 2022


From: Kees Cook
> Sent: 10 February 2022 23:47
...
> All that said, I think this patch could be improved.
> 
> I'd recommend, instead, just simply:
> 
> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index f2f8f05662de..9e765d30da82 100644
> --- a/drivers/acpi/arm64/iort.c
> +++ b/drivers/acpi/arm64/iort.c
> @@ -1671,13 +1671,14 @@ phys_addr_t __init acpi_iort_dma_get_max_cpu_address(void)
>  	end = ACPI_ADD_PTR(struct acpi_iort_node, iort, iort->header.length);
> 
>  	for (i = 0; i < iort->node_count; i++) {
> +		struct acpi_iort_named_component *ncomp;
> +		struct acpi_iort_root_complex *rc;
> +		phys_addr_t local_limit;
> +

I'd move them right to the top of the function.
No point hiding the declarations in the middle.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)




More information about the linux-arm-kernel mailing list