From patchwork Tue Nov 18 09:33:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marc Kleine-Budde X-Patchwork-Id: 411948 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 39CB114011E for ; Tue, 18 Nov 2014 21:19:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7E7D84B6BD; Tue, 18 Nov 2014 11:19:37 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v1N4IWBwly8i; Tue, 18 Nov 2014 11:19:37 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B361B4B682; Tue, 18 Nov 2014 11:19:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 92FFD4B635 for ; Tue, 18 Nov 2014 10:49:57 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W4lXzqMWGTQE for ; Tue, 18 Nov 2014 10:49:57 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [92.198.50.35]) by theia.denx.de (Postfix) with ESMTPS id 733714B61A for ; Tue, 18 Nov 2014 10:49:57 +0100 (CET) Received: from gallifrey.ext.pengutronix.de ([2001:6f8:1178:4:5054:ff:fe8d:eefb] helo=hardanger.do.blackshift.org) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XqfAb-0005eB-1E; Tue, 18 Nov 2014 10:33:57 +0100 From: Marc Kleine-Budde To: Marek Vasut , u-boot@lists.denx.de Date: Tue, 18 Nov 2014 10:33:46 +0100 Message-Id: <1416303226-7419-3-git-send-email-mkl@pengutronix.de> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1416303226-7419-1-git-send-email-mkl@pengutronix.de> References: <1416303226-7419-1-git-send-email-mkl@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:6f8:1178:4:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: u-boot@lists.denx.de X-Mailman-Approved-At: Tue, 18 Nov 2014 11:19:27 +0100 Cc: Marc Kleine-Budde Subject: [U-Boot] [PATCH 2/2] mxssb: fix uninitialized variables warnings X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de These warning are generated by: gcc version 4.9.1 (Debian 4.9.1-19) mxssb.c: In function ‘main’: mxssb.c:1580:10: warning: ‘ilen’ may be used uninitialized in this function [-Wmaybe-uninitialized] ret = sb_build_dcd_block(ictx, cmd, SB_DCD_CHK_EQ | ilen); ^ mxssb.c:1553:12: note: ‘ilen’ was declared here uint32_t ilen; ^ mxssb.c:1556:28: warning: ‘rptr’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (!tok || (strlen(tok) == 0) || (lptr && strlen(lptr) != 1)) { ^ mxssb.c:1495:8: note: ‘rptr’ was declared here char *rptr; ^ Signed-off-by: Marc Kleine-Budde --- mxssb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mxssb.c b/mxssb.c index 14826e7bf84c..3a4c32cf47c9 100644 --- a/mxssb.c +++ b/mxssb.c @@ -1492,7 +1492,7 @@ static int sb_parse_line(struct sb_image_ctx *ictx, struct sb_cmd_list *cmd) { char *tok; char *line = cmd->cmd; - char *rptr; + char *rptr = NULL; int ret; /* Analyze the identifier on this line first. */ @@ -1550,7 +1550,7 @@ static int sb_parse_line(struct sb_image_ctx *ictx, struct sb_cmd_list *cmd) } } else if (ictx->in_dcd) { char *lptr; - uint32_t ilen; + uint32_t ilen = 0; tok = strtok_r(tok, ".", &lptr); if (!tok || (strlen(tok) == 0) || (lptr && strlen(lptr) != 1)) {