From patchwork Tue Jul 3 20:26:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 1153081 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id E2E343FE80 for ; Tue, 3 Jul 2012 20:29:05 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sm9ft-0005rY-VK; Tue, 03 Jul 2012 20:26:18 +0000 Received: from avon.wwwdotorg.org ([2001:470:1f0f:bd7::2]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sm9fo-0005qd-UY for linux-arm-kernel@lists.infradead.org; Tue, 03 Jul 2012 20:26:14 +0000 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 8170262FB; Tue, 3 Jul 2012 14:30:35 -0600 (MDT) Received: from localhost.localdomain (searspoint.nvidia.com [216.228.112.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id A637BE4100; Tue, 3 Jul 2012 14:26:05 -0600 (MDT) From: Stephen Warren To: Mike Turquette Subject: [PATCH] clk: fix used-uninitialized warning in__clk_set_parent Date: Tue, 3 Jul 2012 14:26:00 -0600 Message-Id: <1341347160-21170-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.7.0.4 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.96.5 at avon.wwwdotorg.org X-Virus-Status: Clean X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Stephen Warren , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Stephen Warren This fixes: drivers/clk/clk.c: In function '__clk_set_parent': drivers/clk/clk.c:1069:5: warning: 'i' may be used uninitialized in this function Signed-off-by: Stephen Warren --- drivers/clk/clk.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 026d901..42647ca 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1071,13 +1071,15 @@ static int __clk_set_parent(struct clk *clk, struct clk *parent) old_parent = clk->parent; /* find index of new parent clock using cached parent ptrs */ - if (clk->parents) + if (clk->parents) { for (i = 0; i < clk->num_parents; i++) if (clk->parents[i] == parent) break; - else + } else { clk->parents = kzalloc((sizeof(struct clk*) * clk->num_parents), GFP_KERNEL); + i = clk->num_parents; + } /* * find index of new parent clock using string name comparison