[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161024234841.dk673yxv7fhw5rx3@black.fi.intel.com>
Date: Tue, 25 Oct 2016 02:48:41 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: Hugh Dickins <hughd@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Michal Hocko <mhocko@...e.com>,
Andreas Gruenbacher <agruenba@...hat.com>,
Vlastimil Babka <vbabka@...e.cz>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] shmem: avoid maybe-uninitialized warning
On Mon, Oct 24, 2016 at 10:57:09PM +0200, Arnd Bergmann wrote:
> After enabling -Wmaybe-uninitialized warnings, we get a false-postive
> warning for shmem:
>
> mm/shmem.c: In function ‘shmem_getpage_gfp’:
> include/linux/spinlock.h:332:21: error: ‘info’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> This can be easily avoided, since the correct 'info' pointer is known
> at the time we first enter the function, so we can simply move the
> initialization up. Moving it before the first label avoids the
> warning and lets us remove two later initializations.
>
> Note that the function is so hard to read that it not only confuses
> the compiler, but also most readers and without this patch it could\
> easily break if one of the 'goto's changed.
>
> Link: https://www.spinics.net/lists/kernel/msg2368133.html
> Acked-by: Michal Hocko <mhocko@...e.com>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
Acked-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
--
Kirill A. Shutemov
Powered by blists - more mailing lists