Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1324052

Re: [PATCH] clk: vt8500: don't return possibly uninitialized data

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] clk: vt8500: don't return possibly uninitialized data
Date 2016-02-02 14:00 +0100
Message-ID <qXIIO-32i-5@gated-at.bofh.it> (permalink)
References <qXjU6-19m-11@gated-at.bofh.it> <qXxNo-38h-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Monday 01 February 2016 17:15:45 Stephen Boyd wrote:
> My compiler still gets warnings even after this patch is applied.
> 
> drivers/clk/clk-vt8500.c: In function ‘wm8750_find_pll_bits’:
> drivers/clk/clk-vt8500.c:509:12: warning: ‘best_div2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/clk/clk-vt8500.c:508:12: warning: ‘best_div1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/clk/clk-vt8500.c:507:14: warning: ‘best_mul’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/clk/clk-vt8500.c: In function ‘wm8650_find_pll_bits’:
> drivers/clk/clk-vt8500.c:430:12: warning: ‘best_div2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/clk/clk-vt8500.c:429:12: warning: ‘best_div1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/clk/clk-vt8500.c:428:14: warning: ‘best_mul’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/clk/clk-vt8500.c: In function ‘wm8850_find_pll_bits’:
> drivers/clk/clk-vt8500.c:560:12: warning: ‘best_div2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/clk/clk-vt8500.c:559:12: warning: ‘best_div1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/clk/clk-vt8500.c:558:14: warning: ‘best_mul’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> 

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 initializations which
would shut up the warnings but not help with the code quality.

	Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] clk: vt8500: don't return possibly uninitialized data Arnd Bergmann <arnd@arndb.de> - 2016-02-01 11:30 +0100
  Re: [PATCH] clk: vt8500: don't return possibly uninitialized data Stephen Boyd <sboyd@codeaurora.org> - 2016-02-02 02:20 +0100
    Re: [PATCH] clk: vt8500: don't return possibly uninitialized data Arnd Bergmann <arnd@arndb.de> - 2016-02-02 14:00 +0100
      Re: [PATCH] clk: vt8500: don't return possibly uninitialized data Stephen Boyd <sboyd@codeaurora.org> - 2016-02-02 20:50 +0100
        Re: [PATCH] clk: vt8500: don't return possibly uninitialized data Arnd Bergmann <arnd@arndb.de> - 2016-02-02 21:10 +0100
          Re: [PATCH] clk: vt8500: don't return possibly uninitialized data Roman Volkov <v1ron@mail.ru> - 2016-02-03 09:40 +0100
            Re: [PATCH] clk: vt8500: don't return possibly uninitialized data Arnd Bergmann <arnd@arndb.de> - 2016-02-03 10:20 +0100

csiph-web