[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aAduCoINHUkFwIzR@smile.fi.intel.com>
Date: Tue, 22 Apr 2025 13:23:06 +0300
From: Andy Shevchenko <andy@...nel.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...nel.org>,
Borislav Petkov <bp@...en8.de>, Juergen Gross <jgross@...e.com>,
"H . Peter Anvin" <hpa@...or.com>,
Kees Cook <keescook@...omium.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Mike Rapoport <rppt@...nel.org>,
Paul Menzel <pmenzel@...gen.mpg.de>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
David Woodhouse <dwmw@...zon.co.uk>
Subject: Re: [PATCH 17/29] x86/boot/e820: Standardize e820 table index
variable names under 'idx'
On Mon, Apr 21, 2025 at 08:51:57PM +0200, Ingo Molnar wrote:
...
> + int idx;
> + u32 idx, chg_idx, chg_nr;
What about sanitizing the type as well to be let's say unsigned int idx in all cases?
...
> + change_point[chg_idx]->addr = entries[idx].addr;
> + change_point[chg_idx++]->entry = &entries[idx];
> + change_point[chg_idx]->addr = entries[idx].addr + entries[idx].size;
> + change_point[chg_idx++]->entry = &entries[idx];
Does GCC 15 not produce any warnings here? Linus recently complain on some code
with index increment inside the accessor. Perhaps just
change_point[chg_idx]->entry = &entries[idx];
chg_idx++;
?
...
> + for (idx = 0; idx < overlap_entries; idx++) {
> + if (overlap_list[idx] == change_point[chg_idx]->entry)
> + overlap_list[idx] = overlap_list[overlap_entries-1];
overlap_entries - 1 ?
> }
...
> + while (--idx >= 0) {
while (idx--) {
should work as well, no?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists