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: 12006 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7BB6D23E57 for ; Fri, 5 Oct 2012 14:55:57 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id D74BAA188B1 for ; Fri, 5 Oct 2012 14:55:55 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so3893275iej.11 for ; Fri, 05 Oct 2012 07:55:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=MU8EzKVFXkf3G99kwHniaptAfoYfj1rQC7UKbElS03g=; b=jxGodF0Y0CjkFHnIRG+ATixOCmZMDnw03bRInIGztAGa6IrD+Qv5KzoBcAfQBIC+D7 3JvhEivSOdTdu5LSlFgrJOwzZZZHgJ+fLkP67RSuzUa1YoSz7Z146CDuSr6qawN4e7So OuR2sK0U8koyO36yLOAMWPcmaW1XMyltspnD/C9w4a8m49XGR1ZNh9/9A+V8/Y2ou1yt vvkUEUWgRN+t+ghLobgdVbBIFf3nRgDoe8UogWF08/UBtzYX4t0lVh80piLPIWcQwjm1 A7v/QyTsapSLLrZuriZWBFHr0niBFCL0fFDCxVAiYnP9iD+neE+zwAL2L6FOeFOyqQCD HQXQ== Received: by 10.50.160.165 with SMTP id xl5mr1429650igb.0.1349448955038; Fri, 05 Oct 2012 07:55:55 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp130599igc; Fri, 5 Oct 2012 07:55:54 -0700 (PDT) Received: by 10.14.220.134 with SMTP id o6mr13568882eep.35.1349448952312; Fri, 05 Oct 2012 07:55:52 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.17.10]) by mx.google.com with ESMTPS id 42si2143633eei.105.2012.10.05.07.55.51 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Oct 2012 07:55:52 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.17.10 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.10; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.17.10 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de 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 Cc: linux-kernel@vger.kernel.org, arm@kernel.org, Arnd Bergmann , Al Viro , linux-fsdevel@vger.kernel.org, Jan Kara 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-Gm-Message-State: ALoCoQmNVy1b5OMgg4gvpuF3twXMDI6f9XkxtL2as9F1bSVRLE9z2C23tWDs3OCXSkAwWLRCuNEl 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);