From patchwork Tue Nov 6 21:55:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12699 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 AD5C123E28 for ; Tue, 6 Nov 2012 21:55:49 +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 554A2A19475 for ; Tue, 6 Nov 2012 21:55:49 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so1321975iej.11 for ; Tue, 06 Nov 2012 13:55:48 -0800 (PST) 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=58B/c5lal4gdTaXB59ajsSRoYdh7cf4yBtAMu7NImkI=; b=RS2QBu1WMkq2iKFes8EJVvKiOuByCohb3/wn8kMsi2d+/3sm98juAIj/tULZq+1gui 8784tzy3P7Mip9o58wm7wvmjL19BZgd7WigTOF/d4+PJgjc7f900nUGBlWl7sW+Srw3g K+w20Hd1q/O2TvSpvhjGhjsWbT2PMnlXaXNpeHNn0aCHc50tbdRJny6CQmzC579JuCpz cwPN4o89l5PpTT+NvTWCqjH2QzsqstfDVESulORmPVpgv6IdVyguirqxYvMqeQhRfWzz tm0SavqVuH8TmFerldq4CL4DLgS+syE8tXVB2NjiCVboBE9hWRzw8pgViPLOk94DUxS0 PVmA== Received: by 10.50.152.137 with SMTP id uy9mr2596618igb.62.1352238948770; Tue, 06 Nov 2012 13:55:48 -0800 (PST) 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.67.148 with SMTP id n20csp114506igt; Tue, 6 Nov 2012 13:55:48 -0800 (PST) Received: by 10.14.214.2 with SMTP id b2mr7823227eep.32.1352238947784; Tue, 06 Nov 2012 13:55:47 -0800 (PST) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.17.9]) by mx.google.com with ESMTPS id a9si2517784eeo.66.2012.11.06.13.55.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Nov 2012 13:55:47 -0800 (PST) Received-SPF: neutral (google.com: 212.227.17.9 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.9; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.17.9 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from localhost.localdomain (HSI-KBW-149-172-5-253.hsi13.kabel-badenwuerttemberg.de [149.172.5.253]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Lkzvp-1SxLBJ3Rwb-00aIsI; Tue, 06 Nov 2012 22:55:41 +0100 From: Arnd Bergmann To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , David Woodhouse , Artem Bityutskiy , linux-mtd@lists.infradead.org Subject: [PATCH 3/8] mtd: uninitialized variable warning in map.h Date: Tue, 6 Nov 2012 22:55:28 +0100 Message-Id: <1352238933-4886-4-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1352238933-4886-1-git-send-email-arnd@arndb.de> References: <1352238933-4886-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:k3Tj2nQ00OgWcrL1pAZ83cxbnvg9l5nhpPDe9NvEwho XLnQBaMKyn1C7ZSS3JrjzZ6JnSazB0GGi4qDtZxI7srhEW7F7R oxjHzU83NK/pwz3d6IZQcbWGHvDQ0TGnL4jSN3KtRwniDEGbXW myfKOleb7vZH0GLONZsjx71MoTXNqIAJoJGbuVR328JeDfaYRm mODqiqn5bVcTZmxLqs2wc3mPWTN2MMwHk1esLL6JEB5mCfKDTY rGXEb2EATXpi3PTGpFH1RaUqZQREQWDHucm2x9Fx0uL4dFQLVO CZRIxXz5k2mMJ6e8Rseta2BwPpFCsJS6yeZAV2+aaGaiaOIomR f7WAoTagJSHOQpiogTuRvViITQry9OeO5p9VzKTL4ro/kfYqd8 U4bYkfFrVWZZw== X-Gm-Message-State: ALoCoQmEm/eZf3nakh/O3YSkCHewjH0mnsePF6SxQVemSQ20kmdzDCr+LlB6I0BUav29shBefNHC The map_word_load() function initializes exactly as many words in the buffer as required, but gcc cannot figure this out and gives a misleading warning. Marking the local variable as uninitialized_var shuts up that warning. Without this patch, building acs5k_defconfig results in: drivers/mtd/chips/cfi_cmdset_0002.c: In function 'cfi_amdstd_panic_write': include/linux/mtd/map.h:331:11: warning: 'r.x[0]' may be used uninitialized in this function [-Wuninitialized] drivers/mtd/chips/cfi_cmdset_0002.c: In function 'cfi_amdstd_write_words': include/linux/mtd/map.h:331:11: warning: 'r.x[0]' may be used uninitialized in this function [-Wuninitialized] drivers/mtd/chips/cfi_cmdset_0001.c: In function 'cfi_intelext_write_words': include/linux/mtd/map.h:331:11: warning: 'r.x[0]' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Arnd Bergmann Cc: David Woodhouse Cc: Artem Bityutskiy Cc: linux-mtd@lists.infradead.org --- include/linux/mtd/map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index 3595a02..e3559ba 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h @@ -328,7 +328,7 @@ static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word static inline map_word map_word_load(struct map_info *map, const void *ptr) { - map_word r; + map_word uninitialized_var(r); if (map_bankwidth_is_1(map)) r.x[0] = *(unsigned char *)ptr;