From patchwork Thu May 7 06:41:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 469293 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CBB9614027F for ; Thu, 7 May 2015 16:42:27 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=jms.id.au header.i=@jms.id.au header.b=hXFp4ps5; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id A7B301A0B8D for ; Thu, 7 May 2015 16:42:27 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=jms.id.au header.i=@jms.id.au header.b=hXFp4ps5; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pd0-x22e.google.com (mail-pd0-x22e.google.com [IPv6:2607:f8b0:400e:c02::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id DA16A1A05EB for ; Thu, 7 May 2015 16:42:23 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=jms.id.au header.i=@jms.id.au header.b=hXFp4ps5; dkim-atps=neutral Received: by pdbnk13 with SMTP id nk13so32729324pdb.0 for ; Wed, 06 May 2015 23:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=elGfn+KFWUT298nKGLgt+0CSRjg0viMAerosm5nEHbo=; b=hXFp4ps5CpPwf/hHF89TX7Amdrb8r0AW+iyx3IBsS8caVj3x8Ikl65+xCxArzfsWDE yM0R6/V1Ntf/m1wm/ugjESXh2769ixvK/yrpvCbFrtAGyHUDR6ESMR9EmmmW6rbbw3aJ hBNx+3WVm6+oSzi7cvr8bhqz1YvoHBikFt69k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=elGfn+KFWUT298nKGLgt+0CSRjg0viMAerosm5nEHbo=; b=F9WDBTFmL8i80HAA1VbLijiPmdOJeY2+h56NS+aJF1Lhg+/QxWPvhGahoCDkE6lBKY bI9cACID8BDBeH3guogF5QN8V8vax0QvmYHueygDp6Oh4ovBFhtssmfVzmDQgx5NsGxU aARv61tv8WXGKprPzPcdbClQc4B+3b4K3c8w/eav5AEowc7viPQJiG0uiyCM0SJksxvo fSRkBNjmuk677TTxQzuWQkYP09hKiiDgkh3n6I5cOCnrzwsbiO84ZHHXwUPwTYEdzl5B XIb/b3g5D4HO10umKU901mH/lhQgXA/tNjtfUeENHFq+K+pT5vbNHf6Ir/GhD9EelP56 tbQw== X-Gm-Message-State: ALoCoQlHvMhZY6HZrfPqL44iiZth0dic9dACMZtl8E7JWJg9zsMYaKCXPgsW+5hYBixBg07Kmqbz X-Received: by 10.70.135.168 with SMTP id pt8mr4395176pdb.8.1430980941897; Wed, 06 May 2015 23:42:21 -0700 (PDT) Received: from icarus.au.ibm.com (220-244-113-206.static.tpgi.com.au. [220.244.113.206]) by mx.google.com with ESMTPSA id qm2sm994792pdb.57.2015.05.06.23.42.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 May 2015 23:42:21 -0700 (PDT) From: Joel Stanley To: skiboot@lists.ozlabs.org Date: Thu, 7 May 2015 16:11:24 +0930 Message-Id: <1430980885-639-3-git-send-email-joel@jms.id.au> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1430980885-639-1-git-send-email-joel@jms.id.au> References: <1430980885-639-1-git-send-email-joel@jms.id.au> Subject: [Skiboot] [PATCH 2/3] rhesus: Fix uninitialised variable warning X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" platforms/rhesus/rhesus.c:126:6: error: variable 'pnor_chip' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (rc) { ^~ platforms/rhesus/rhesus.c:141:6: note: uninitialized use occurs here if (pnor_chip) ^~~~~~~~~ platforms/rhesus/rhesus.c:126:2: note: remove the 'if' if its condition is always false if (rc) { ^~~~~~~~~ platforms/rhesus/rhesus.c:121:30: note: initialize the variable 'pnor_chip' to silence this warning struct flash_chip *pnor_chip; ^ = NULL Signed-off-by: Joel Stanley --- platforms/rhesus/rhesus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/rhesus/rhesus.c b/platforms/rhesus/rhesus.c index 50769cf..27e1c91 100644 --- a/platforms/rhesus/rhesus.c +++ b/platforms/rhesus/rhesus.c @@ -118,7 +118,7 @@ static int64_t rhesus_power_down(uint64_t request __unused) static int rhesus_pnor_init(void) { struct spi_flash_ctrl *pnor_ctrl; - struct flash_chip *pnor_chip; + struct flash_chip *pnor_chip = NULL; int rc; /* Open controller, flash and ffs */