From: David Laight <David.Laight@ACULAB.COM>
To: 'Kees Cook' <keescook@chromium.org>, Ard Biesheuvel <ardb@kernel.org>
Cc: Victor Erminpour <victor.erminpour@oracle.com>,
Robin Murphy <robin.murphy@arm.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Hanjun Guo <guohanjun@huawei.com>,
Sudeep Holla <sudeep.holla@arm.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
"ACPI Devel Maling List" <linux-acpi@vger.kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"trivial@kernel.org" <trivial@kernel.org>
Subject: RE: [PATCH v2] ACPI/IORT: Fix GCC 12 warning
Date: Sun, 13 Feb 2022 02:20:27 +0000 [thread overview]
Message-ID: <26dee09f5fc8420782e4556d86c55a04@AcuMS.aculab.com> (raw)
In-Reply-To: <202202101415.43750CEE@keescook>
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)
prev parent reply other threads:[~2022-02-13 2:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-10 18:47 [PATCH v2] ACPI/IORT: Fix GCC 12 warning Victor Erminpour
2022-02-10 19:41 ` Ard Biesheuvel
2022-02-10 23:47 ` Kees Cook
2022-02-11 10:34 ` Robin Murphy
2022-02-11 11:43 ` Ard Biesheuvel
2022-02-11 12:15 ` Robin Murphy
2022-02-11 17:08 ` Ard Biesheuvel
2022-02-11 17:11 ` Robin Murphy
2022-02-12 0:37 ` Kees Cook
2022-02-12 4:50 ` Joe Perches
2022-02-13 3:33 ` David Laight
2022-02-13 2:20 ` David Laight [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=26dee09f5fc8420782e4556d86c55a04@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=ardb@kernel.org \
--cc=guohanjun@huawei.com \
--cc=keescook@chromium.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=rafael@kernel.org \
--cc=robin.murphy@arm.com \
--cc=sudeep.holla@arm.com \
--cc=trivial@kernel.org \
--cc=victor.erminpour@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox