Re: [PATCH] [PATCH v2] mm: initialize 'seq' in gup_fast to remove -Wmaybe-uninitialized warning
From: Matthew Wilcox
Date: Mon Mar 02 2026 - 14:58:18 EST
On Mon, Mar 02, 2026 at 11:48:35AM -0800, Joshua Hahn wrote:
> Unfortunately I think that this patch is still unneeded. The variable seq is
> used in two places, raw_seqcount_try_begin and read_seqcount_retry, and nowhere
> else in the function. Both are guarded by if (gup_flags & FOLL_PIN).
Yeah, historically GCC wasn't great with that pattern. It failed to
notice that the condition was the same and so there was no path through
the code that would use an uninit variable. Hence my question about
what compiler version he's using to see whether we can disregard this
because it's an old compiler that we don't support any more.