From patchwork Mon Oct 29 17:17:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12569 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 54BD523F56 for ; Mon, 29 Oct 2012 17:17:48 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 027DFA181F1 for ; Mon, 29 Oct 2012 17:17:47 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so3912849iag.11 for ; Mon, 29 Oct 2012 10:17:47 -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:x-gm-message-state; bh=DfCbATXsvHnusvqvvzkS3yL7x93IFglF5/4fTPq4GRY=; b=UzbaZ0wIJIBMH6QsMCDaw305mhoqMfW2nCKvWUH5YYPgGMgk+IlAobGvlxJ0mxTSgH 9j7dqnL17UNkp4Ol/2kQeR3WMBYF4s4cgvup6m/qXbJldraNf0F86CyyAQyU72ONQ6cP eW9GeysdLbFfD16wXWq8DPfh/sI3YhXR5q0q5pkWbRZwoThOC6vWvF81rkcY3FE6KhNE n+HiNVkcnORuSLeggnZA2W2c/9CDQj2W4rcrKJxY1hYO3/PD8L+1HK/ehUFAjMoKHKfQ 0wQr3wXsKOARgl2c+YSUeduLxh7uSGLqyqnhIVZSHLmmxvbjZoR7rp/fwx4czRaaSuti hcaw== Received: by 10.50.100.137 with SMTP id ey9mr10204461igb.57.1351531067422; Mon, 29 Oct 2012 10:17:47 -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.67.148 with SMTP id n20csp246781igt; Mon, 29 Oct 2012 10:17:46 -0700 (PDT) Received: by 10.68.237.167 with SMTP id vd7mr85309486pbc.161.1351531066450; Mon, 29 Oct 2012 10:17:46 -0700 (PDT) Received: from mail-da0-f50.google.com (mail-da0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id bo5si13290319pab.247.2012.10.29.10.17.45 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Oct 2012 10:17:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) smtp.mail=viresh.kumar@linaro.org Received: by mail-da0-f50.google.com with SMTP id z20so2584446dae.37 for ; Mon, 29 Oct 2012 10:17:45 -0700 (PDT) Received: by 10.68.231.3 with SMTP id tc3mr37824978pbc.89.1351531065535; Mon, 29 Oct 2012 10:17:45 -0700 (PDT) Received: from localhost ([122.167.106.199]) by mx.google.com with ESMTPS id ix9sm6277748pbc.7.2012.10.29.10.17.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Oct 2012 10:17:40 -0700 (PDT) From: Viresh Kumar To: dwmw2@infradead.org Cc: linaro-dev@lists.linaro.org, patches@linaro.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dedekind1@gmail.com, Viresh Kumar Subject: [PATCH] mtd: map: Fix compilation warning Date: Mon, 29 Oct 2012 22:47:26 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e X-Gm-Message-State: ALoCoQkjVietclzJymJJ7V+0bW1Xq4fWxYFYC6/FmpsgHb02eQbIS12bxBdEfuoTZoPEABJrIh1A This patch is an attempt to fix following compilation warning. In file included from drivers/mtd/chips/cfi_cmdset_0001.c:35:0: 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 [-Wmaybe-uninitialized] I could have used uninitialized_var() too, but didn't used it as the final else part of map_word_load() is missing. So there is a chance that it might be passed uninitialized. Better initialize to zero. Signed-off-by: Viresh Kumar --- 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..56c7936 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 r = {{0} }; if (map_bankwidth_is_1(map)) r.x[0] = *(unsigned char *)ptr;