From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Arnd Bergmann To: Stephen Boyd Cc: Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Andrzej Hajda , linux-arm-kernel@lists.infradead.org, Tony Prisk , Roman Volkov Subject: Re: [PATCH] clk: vt8500: don't return possibly uninitialized data Date: Tue, 02 Feb 2016 13:49:56 +0100 Message-ID: <2210116.QsPesySkh0@wuerfel> In-Reply-To: <20160202011545.GG4848@codeaurora.org> References: <4790407.6zgSQCdsSB@wuerfel> <20160202011545.GG4848@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" List-ID: On Monday 01 February 2016 17:15:45 Stephen Boyd wrote: > My compiler still gets warnings even after this patch is applied. >=20 > drivers/clk/clk-vt8500.c: In function =E2=80=98wm8750_find_pll_bits=E2= =80=99: > drivers/clk/clk-vt8500.c:509:12: warning: =E2=80=98best_div2=E2=80=99= may be used uninitialized in this function [-Wmaybe-uninitialized] > drivers/clk/clk-vt8500.c:508:12: warning: =E2=80=98best_div1=E2=80=99= may be used uninitialized in this function [-Wmaybe-uninitialized] > drivers/clk/clk-vt8500.c:507:14: warning: =E2=80=98best_mul=E2=80=99 = may be used uninitialized in this function [-Wmaybe-uninitialized] > drivers/clk/clk-vt8500.c: In function =E2=80=98wm8650_find_pll_bits=E2= =80=99: > drivers/clk/clk-vt8500.c:430:12: warning: =E2=80=98best_div2=E2=80=99= may be used uninitialized in this function [-Wmaybe-uninitialized] > drivers/clk/clk-vt8500.c:429:12: warning: =E2=80=98best_div1=E2=80=99= may be used uninitialized in this function [-Wmaybe-uninitialized] > drivers/clk/clk-vt8500.c:428:14: warning: =E2=80=98best_mul=E2=80=99 = may be used uninitialized in this function [-Wmaybe-uninitialized] > drivers/clk/clk-vt8500.c: In function =E2=80=98wm8850_find_pll_bits=E2= =80=99: > drivers/clk/clk-vt8500.c:560:12: warning: =E2=80=98best_div2=E2=80=99= may be used uninitialized in this function [-Wmaybe-uninitialized] > drivers/clk/clk-vt8500.c:559:12: warning: =E2=80=98best_div1=E2=80=99= may be used uninitialized in this function [-Wmaybe-uninitialized] > drivers/clk/clk-vt8500.c:558:14: warning: =E2=80=98best_mul=E2=80=99 = may be used uninitialized in this function [-Wmaybe-uninitialized] >=20 I see what you mean now. I checked different gcc versions, and with my = patch I get the warnings for 4.6 through 4.9, but not for 5.x. In general, I tried to only address warnings I still see with newer gcc= version, as they are better about false positives. Do you think it's ok to take = the patch as is then? Otherwise we probably have to add fake initialization= s which would shut up the warnings but not help with the code quality. =09Arnd