Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965457AbbBQL4R (ORCPT ); Tue, 17 Feb 2015 06:56:17 -0500 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:39842 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756931AbbBQLfN (ORCPT ); Tue, 17 Feb 2015 06:35:13 -0500 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Peter=20K=C3=BCmmel?= , Michal Marek , Sedat Dilek , Jiri Slaby Subject: [PATCH 3.12 067/122] =?UTF-8?q?kconfig:=20Fix=20warning=20"?= =?UTF-8?q?=E2=80=98jump=E2=80=99=20may=20be=20used=20uninitialized"?= Date: Tue, 17 Feb 2015 12:34:14 +0100 Message-Id: <737a342fa7217fadd2e3c52ecfbfe1e9d307fa60.1424099973.git.jslaby@suse.cz> X-Mailer: git-send-email 2.2.2 In-Reply-To: <09e6fe32192a77f6e2e60cc0f4103e630c7ecf20.1424099973.git.jslaby@suse.cz> References: <09e6fe32192a77f6e2e60cc0f4103e630c7ecf20.1424099973.git.jslaby@suse.cz> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1957 Lines: 55 From: Peter Kümmel 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit 2d560306096739e2251329ab5c16059311a151b0 upstream. Warning: In file included from scripts/kconfig/zconf.tab.c:2537:0: scripts/kconfig/menu.c: In function ‘get_symbol_str’: scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized] jump->offset = strlen(r->s); Simplifies the test logic because (head && local) means (jump != 0) and makes GCC happy when checking if the jump pointer was initialized. Signed-off-by: Peter Kümmel Signed-off-by: Michal Marek Cc: Sedat Dilek Signed-off-by: Jiri Slaby --- scripts/kconfig/menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 2b3317010ba4..c81f055343b7 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -544,7 +544,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop, { int i, j; struct menu *submenu[8], *menu, *location = NULL; - struct jump_key *jump; + struct jump_key *jump = NULL; str_printf(r, _("Prompt: %s\n"), _(prop->text)); menu = prop->menu->parent; @@ -582,7 +582,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop, str_printf(r, _(" Location:\n")); for (j = 4; --i >= 0; j += 2) { menu = submenu[i]; - if (head && location && menu == location) + if (jump && menu == location) jump->offset = strlen(r->s); str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu))); -- 2.2.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/