From patchwork Tue May 24 20:07:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Volkov X-Patchwork-Id: 9134245 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F0626075E for ; Tue, 24 May 2016 20:12:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54E8C281F9 for ; Tue, 24 May 2016 20:12:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49C04282A0; Tue, 24 May 2016 20:12:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8021281F9 for ; Tue, 24 May 2016 20:12:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932922AbcEXUMx (ORCPT ); Tue, 24 May 2016 16:12:53 -0400 Received: from fallback5.mail.ru ([94.100.181.253]:42724 "EHLO fallback5.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932629AbcEXUMw (ORCPT ); Tue, 24 May 2016 16:12:52 -0400 Received: from smtp22.mail.ru (smtp22.mail.ru [94.100.181.177]) by fallback5.mail.ru (mPOP.Fallback_MX) with ESMTP id 004F4B17A0CF; Tue, 24 May 2016 23:12:49 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=0xt0GKVAnL0sDtovRLZaagOwNpjRCxNJ1FYIsx/5v4I=; b=MBlhCUAQYdG1ixSPVfQiXf/SmL+SC9348/niHWbzFZGu4aL14QIAZVF2FjWSyWSjrzsFbSG6YUl7ref7pvrkFz8AV9HOsS4vIyAAzDZ+WuDuSgv/+RMugnnk/cvFuDHpPWTyVi8nPSXGqCwCRob3iPrm8GbGPQAQQbzgVUYfXBg=; Received: from [176.213.0.43] (port=57620 helo=v1ron-s7.localdomain) by smtp22.mail.ru with esmtpa (envelope-from ) id 1b5Ih2-0001At-0H; Tue, 24 May 2016 23:12:45 +0300 From: Roman Volkov To: Arnd Bergmann Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Boyd , Michael Turquette , Roman Volkov , Tony Prisk Subject: [PATCH 2/2] clk/vt8500: Fix compilation warnings Date: Tue, 24 May 2016 23:07:53 +0300 Message-Id: <1464120473-1808-3-git-send-email-v1ron@mail.ru> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1464120473-1808-1-git-send-email-v1ron@mail.ru> References: <1464120473-1808-1-git-send-email-v1ron@mail.ru> X-Mras: OK Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Roman Volkov GCC 5.3.0 still throws the following warnings for functions wm8750_find_pll_bits() and wm8850_find_pll_bits(): warning: 'best_div2' may be used uninitialized in this function warning: 'best_div1' may be used uninitialized in this function warning: 'best_mul' may be used uninitialized in this function These warnings are false positives, the variables are controlled by checking the value of the variable 'best_err' which is -1 by default. It is safe to initialize all these variables to zero. Fixes: 090341b0a95d ("clk: vt8500: fix sign of possible PLL values") Signed-off-by: Roman Volkov --- drivers/clk/clk-vt8500.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-vt8500.c b/drivers/clk/clk-vt8500.c index 77650f19a9b6..7c970d7c0a6a 100644 --- a/drivers/clk/clk-vt8500.c +++ b/drivers/clk/clk-vt8500.c @@ -461,7 +461,7 @@ static int wm8750_find_pll_bits(unsigned long rate, unsigned long parent_rate, { u32 mul; int div1, div2; - u32 best_mul, best_div1, best_div2; + u32 best_mul = 0, best_div1 = 0, best_div2 = 0; unsigned long tclk, rate_err, best_err; best_err = (unsigned long)-1; @@ -513,7 +513,7 @@ static int wm8850_find_pll_bits(unsigned long rate, unsigned long parent_rate, { u32 mul; int div1, div2; - u32 best_mul, best_div1, best_div2; + u32 best_mul = 0, best_div1 = 0, best_div2 = 0; unsigned long tclk, rate_err, best_err; best_err = (unsigned long)-1;