From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424512AbdD1Ii3 (ORCPT ); Fri, 28 Apr 2017 04:38:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56108 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423047AbdD1Ifi (ORCPT ); Fri, 28 Apr 2017 04:35:38 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Arnd Bergmann Subject: [PATCH 3.18 19/47] dm bufio: hide bogus warning Date: Fri, 28 Apr 2017 10:32:32 +0200 Message-Id: <20170428083039.151258652@linuxfoundation.org> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170428083038.327543269@linuxfoundation.org> References: <20170428083038.327543269@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann mips-gcc-5.3 warns about correct code on linux-3.18 and earlier: In file included from ../include/linux/blkdev.h:4:0, from ../drivers/md/dm-bufio.h:12, from ../drivers/md/dm-bufio.c:9: ../drivers/md/dm-bufio.c: In function 'alloc_buffer': ../include/linux/sched.h:1975:56: warning: 'noio_flag' may be used uninitialized in this function [-Wmaybe-uninitialized] current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ../drivers/md/dm-bufio.c:325:11: note: 'noio_flag' was declared here The warning disappeared on later kernels with this commit: be0c37c985ed ("MIPS: Rearrange PTE bits into fixed positions.") I assume this only happened because it changed some inlining decisions. On 3.18.y, we can shut up the warning by adding an extra initialization. Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-bufio.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -349,6 +349,7 @@ static void *alloc_buffer_data(struct dm * as if GFP_NOIO was specified. */ + noio_flag = 0; if (gfp_mask & __GFP_NORETRY) noio_flag = memalloc_noio_save();