From: rtg.canonical@gmail.com Subject: [PATCH 3.17-rc2] fs: namespace: suppress 'may be used uninitialized' warnings Date: Wed, 27 Aug 2014 13:51:05 -0600 Message-ID: <1409169065-61597-1-git-send-email-tim.gardner@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Tim Gardner , Alexander Viro To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Return-path: Received: from mail-pa0-f42.google.com ([209.85.220.42]:54446 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755657AbaH0Tvo (ORCPT ); Wed, 27 Aug 2014 15:51:44 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: =46rom: Tim Gardner The gcc version 4.9.1 compiler complains Even though it isn't possible = for these variables to not get initialized before they are used. fs/namespace.c: In function =E2=80=98SyS_mount=E2=80=99: fs/namespace.c:2720:8: warning: =E2=80=98kernel_dev=E2=80=99 may be use= d uninitialized in this function [-Wmaybe-uninitialized] ret =3D do_mount(kernel_dev, kernel_dir->name, kernel_type, flags, ^ fs/namespace.c:2699:8: note: =E2=80=98kernel_dev=E2=80=99 was declared = here char *kernel_dev; ^ fs/namespace.c:2720:8: warning: =E2=80=98kernel_type=E2=80=99 may be us= ed uninitialized in this function [-Wmaybe-uninitialized] ret =3D do_mount(kernel_dev, kernel_dir->name, kernel_type, flags, ^ fs/namespace.c:2697:8: note: =E2=80=98kernel_type=E2=80=99 was declared= here char *kernel_type; ^ Cc: Alexander Viro Signed-off-by: Tim Gardner --- fs/namespace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index 20232e4..8681260 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2694,9 +2694,9 @@ SYSCALL_DEFINE5(mount, char __user *, dev_name, c= har __user *, dir_name, char __user *, type, unsigned long, flags, void __user *, data) { int ret; - char *kernel_type; + char *uninitialized_var(kernel_type); struct filename *kernel_dir; - char *kernel_dev; + char *uninitialized_var(kernel_dev); unsigned long data_page; =20 ret =3D copy_mount_string(type, &kernel_type); --=20 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html