From patchwork Fri Oct 5 14:55:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1553731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 898D2DF24C for ; Fri, 5 Oct 2012 15:02:22 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TK9Ml-00054H-Fr; Fri, 05 Oct 2012 14:59:03 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TK9Jt-0003af-6c for linux-arm-kernel@lists.infradead.org; Fri, 05 Oct 2012 14:56:16 +0000 Received: from klappe2.boeblingen.de.ibm.com (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0MKgdv-1TIm0K0icZ-001xQp; Fri, 05 Oct 2012 16:55:47 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/16] vfs: bogus warnings in fs/namei.c Date: Fri, 5 Oct 2012 16:55:19 +0200 Message-Id: <1349448930-23976-6-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1349448930-23976-1-git-send-email-arnd@arndb.de> References: <1349448930-23976-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:/d/nXk3/xy5hi5Wq/VQejeaCvOERxxJn2uBOaUyxiXT bXvXvR/bhOrocHZjnAbXw1PHLyJZTPCQu3c+EwEZ5OHIsNxXfc Ngpusy+2GWN4ekE+RRaNR6zHc5nIuQjUoMWeeFyqrBufeP5pSW kT7Njcvcv7Lf0hAN0dDmbqex8vtAqChR5q/HQaIcKbrIQ5+dcH t5450JKZe38IHJEjLoMN0rKgv6kuDmipysJww77juDh16W+hbk r5VtoNiSy4kC+8ISDpl/Y2yvk1p7T74tIbmcHec7tSMi0a/CXz fNSBKniOX8hP2RI+rHla9atd6Iv6P4aKOnagvLDzIEG9Grk26o mtIxj+dBKSUTCfk5DbJ3GZEY8altqpzH1W3SzqQuX0Kehh66cc WXySddJY+Hsj4JqVNGwI811PJZIPZ7xQXQ= X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.10 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Jan Kara , Arnd Bergmann , linux-kernel@vger.kernel.org, arm@kernel.org, Al Viro , linux-fsdevel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The follow_link() function always initializes its *p argument, or returns an error, but not all versions of gcc figure this out, so we have to work around this using the uninitialized_var() macro. Without this patch, building with arm-linux-gnueabi-gcc-4.6 results in: fs/namei.c: In function 'link_path_walk': fs/namei.c:649:24: warning: 'cookie' may be used uninitialized in this function [-Wuninitialized] fs/namei.c:1544:9: note: 'cookie' was declared here fs/namei.c: In function 'path_lookupat': fs/namei.c:649:24: warning: 'cookie' may be used uninitialized in this function [-Wuninitialized] fs/namei.c:1934:10: note: 'cookie' was declared here fs/namei.c: In function 'path_openat': fs/namei.c:649:24: warning: 'cookie' may be used uninitialized in this function [-Wuninitialized] fs/namei.c:2899:9: note: 'cookie' was declared here Signed-off-by: Arnd Bergmann Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org Cc: Jan Kara --- fs/namei.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index dd1ed1b..62a1725 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1543,7 +1543,7 @@ static inline int nested_symlink(struct path *path, struct nameidata *nd) do { struct path link = *path; - void *cookie; + void *uninitialized_var(cookie); res = follow_link(&link, nd, &cookie); if (res) @@ -1933,7 +1933,7 @@ static int path_lookupat(int dfd, const char *name, if (!err && !(flags & LOOKUP_PARENT)) { err = lookup_last(nd, &path); while (err > 0) { - void *cookie; + void *uninitialized_var(cookie); struct path link = path; err = may_follow_link(&link, nd); if (unlikely(err)) @@ -2902,7 +2902,7 @@ static struct file *path_openat(int dfd, const char *pathname, error = do_last(nd, &path, file, op, &opened, pathname); while (unlikely(error > 0)) { /* trailing symlink */ struct path link = path; - void *cookie; + void *uninitialized_var(cookie); if (!(nd->flags & LOOKUP_FOLLOW)) { path_put_conditional(&path, nd); path_put(&nd->path);