Re: [PATCH] mm/vmscan: avoid false-positive -Wuninitialized warning
From: Andrew Morton
Date: Thu Mar 26 2026 - 22:19:13 EST
On Tue, 17 Feb 2026 13:22:01 -0800 Axel Rasmussen <axelrasmussen@xxxxxxxxxx> wrote:
> > > Let's see what the MGLRU maintainers have to say.
> >
> > I went over the various cases of read_ctrl_pos and couldn't find
> > anything wrong (let me know if I'm mistaken), so this seems like a
> > mild compiler bug we're trying to work around. Given it's one single
> > version of gcc, I'm a fan of the simple `struct ctrl_pos sp, pv = {};`
> > with a comment.
>
> Agreed, that simpler change with a comment seems better to me.
>
> I don't necessarily hate the refactor to split up the single /
> aggregate cases, but if we were going to do that I'd probably have
> aggregate_ctrl_pos call read_ctrl_pos to avoid duplicating the code,
> and I'd want to consider marking read_ctrl_pos inline.
>
> But, it does seem like a large delta just to work around a false
> positive warning. The simpler change would be easier to backport to
> stable too for example. So on balance I'd prefer that.
Thanks. Did anyone send a v2? If so, I misplaced it!