[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <26dee09f5fc8420782e4556d86c55a04@AcuMS.aculab.com>
Date: Sun, 13 Feb 2022 02:20:27 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Kees Cook' <keescook@...omium.org>,
Ard Biesheuvel <ardb@...nel.org>
CC: Victor Erminpour <victor.erminpour@...cle.com>,
Robin Murphy <robin.murphy@....com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Hanjun Guo <guohanjun@...wei.com>,
Sudeep Holla <sudeep.holla@....com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>,
"ACPI Devel Maling List" <linux-acpi@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"trivial@...nel.org" <trivial@...nel.org>
Subject: RE: [PATCH v2] ACPI/IORT: Fix GCC 12 warning
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)
Powered by blists - more mailing lists