Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-03-07 Thread Austin, Brian
> On Mar 6, 2016, at 10:19 PM, Arnd Bergmann wrote: > > gcc warns about the possibilty of accessing a property read from > devicetree in cs35l32_i2c_probe() when it has not been initialized > because CONFIG_OF is disabled: > > sound/soc/codecs/cs35l32.c: In function

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-03-07 Thread Austin, Brian
> On Mar 6, 2016, at 10:19 PM, Arnd Bergmann wrote: > > gcc warns about the possibilty of accessing a property read from > devicetree in cs35l32_i2c_probe() when it has not been initialized > because CONFIG_OF is disabled: > > sound/soc/codecs/cs35l32.c: In function 'cs35l32_i2c_probe': >

[PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-03-06 Thread Arnd Bergmann
gcc warns about the possibilty of accessing a property read from devicetree in cs35l32_i2c_probe() when it has not been initialized because CONFIG_OF is disabled: sound/soc/codecs/cs35l32.c: In function 'cs35l32_i2c_probe': sound/soc/codecs/cs35l32.c:278:2: warning: 'val' may be used

[PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-03-06 Thread Arnd Bergmann
gcc warns about the possibilty of accessing a property read from devicetree in cs35l32_i2c_probe() when it has not been initialized because CONFIG_OF is disabled: sound/soc/codecs/cs35l32.c: In function 'cs35l32_i2c_probe': sound/soc/codecs/cs35l32.c:278:2: warning: 'val' may be used

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-04 Thread Russell King - ARM Linux
On Mon, Jan 04, 2016 at 05:41:05PM +0100, Arnd Bergmann wrote: > That reminds of a different problem that has been bugging me for a > while: We frequently have a pattern like > > #ifdef CONFIG_FOO > static int function(void) > { > ... > } > #endif > > struct operations = { > ... >

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-04 Thread Arnd Bergmann
On Monday 04 January 2016 15:20:58 Russell King - ARM Linux wrote: > On Mon, Jan 04, 2016 at 04:17:47PM +0100, Arnd Bergmann wrote: > > On Saturday 02 January 2016 14:17:46 Mark Brown wrote: > > > On Sat, Jan 02, 2016 at 12:19:52AM +0100, Arnd Bergmann wrote: > > > > > > > - if

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-04 Thread Mark Brown
On Mon, Jan 04, 2016 at 04:17:47PM +0100, Arnd Bergmann wrote: > On Saturday 02 January 2016 14:17:46 Mark Brown wrote: > > This would be a lot nicer if there was an __always_null annotation we > > could put on of_node for !OF configurations, that'd Just Work and this > > can't be the only case

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-04 Thread Russell King - ARM Linux
On Mon, Jan 04, 2016 at 04:17:47PM +0100, Arnd Bergmann wrote: > On Saturday 02 January 2016 14:17:46 Mark Brown wrote: > > On Sat, Jan 02, 2016 at 12:19:52AM +0100, Arnd Bergmann wrote: > > > > > - if (i2c_client->dev.of_node) { > > > + if (IS_ENABLED(CONFIG_OF) &&

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-04 Thread Arnd Bergmann
On Saturday 02 January 2016 14:17:46 Mark Brown wrote: > On Sat, Jan 02, 2016 at 12:19:52AM +0100, Arnd Bergmann wrote: > > > - if (i2c_client->dev.of_node) { > > + if (IS_ENABLED(CONFIG_OF) && i2c_client->dev.of_node) { > > This would be a lot nicer if there was an

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-04 Thread Russell King - ARM Linux
On Mon, Jan 04, 2016 at 04:17:47PM +0100, Arnd Bergmann wrote: > On Saturday 02 January 2016 14:17:46 Mark Brown wrote: > > On Sat, Jan 02, 2016 at 12:19:52AM +0100, Arnd Bergmann wrote: > > > > > - if (i2c_client->dev.of_node) { > > > + if (IS_ENABLED(CONFIG_OF) &&

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-04 Thread Mark Brown
On Mon, Jan 04, 2016 at 04:17:47PM +0100, Arnd Bergmann wrote: > On Saturday 02 January 2016 14:17:46 Mark Brown wrote: > > This would be a lot nicer if there was an __always_null annotation we > > could put on of_node for !OF configurations, that'd Just Work and this > > can't be the only case

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-04 Thread Arnd Bergmann
On Saturday 02 January 2016 14:17:46 Mark Brown wrote: > On Sat, Jan 02, 2016 at 12:19:52AM +0100, Arnd Bergmann wrote: > > > - if (i2c_client->dev.of_node) { > > + if (IS_ENABLED(CONFIG_OF) && i2c_client->dev.of_node) { > > This would be a lot nicer if there was an

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-04 Thread Arnd Bergmann
On Monday 04 January 2016 15:20:58 Russell King - ARM Linux wrote: > On Mon, Jan 04, 2016 at 04:17:47PM +0100, Arnd Bergmann wrote: > > On Saturday 02 January 2016 14:17:46 Mark Brown wrote: > > > On Sat, Jan 02, 2016 at 12:19:52AM +0100, Arnd Bergmann wrote: > > > > > > > - if

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-04 Thread Russell King - ARM Linux
On Mon, Jan 04, 2016 at 05:41:05PM +0100, Arnd Bergmann wrote: > That reminds of a different problem that has been bugging me for a > while: We frequently have a pattern like > > #ifdef CONFIG_FOO > static int function(void) > { > ... > } > #endif > > struct operations = { > ... >

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-02 Thread Mark Brown
On Sat, Jan 02, 2016 at 12:19:52AM +0100, Arnd Bergmann wrote: > - if (i2c_client->dev.of_node) { > + if (IS_ENABLED(CONFIG_OF) && i2c_client->dev.of_node) { This would be a lot nicer if there was an __always_null annotation we could put on of_node for !OF configurations,

Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-02 Thread Mark Brown
On Sat, Jan 02, 2016 at 12:19:52AM +0100, Arnd Bergmann wrote: > - if (i2c_client->dev.of_node) { > + if (IS_ENABLED(CONFIG_OF) && i2c_client->dev.of_node) { This would be a lot nicer if there was an __always_null annotation we could put on of_node for !OF configurations,

[PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-01 Thread Arnd Bergmann
gcc warns about the possibilty of accessing a property read from devicetree in cs35l32_i2c_probe() when it has not been initialized because CONFIG_OF is disabled: sound/soc/codecs/cs35l32.c: In function 'cs35l32_i2c_probe': sound/soc/codecs/cs35l32.c:278:2: warning: 'val' may be used

[PATCH] ASoC: cs35l32: avoid uninitialized variable access

2016-01-01 Thread Arnd Bergmann
gcc warns about the possibilty of accessing a property read from devicetree in cs35l32_i2c_probe() when it has not been initialized because CONFIG_OF is disabled: sound/soc/codecs/cs35l32.c: In function 'cs35l32_i2c_probe': sound/soc/codecs/cs35l32.c:278:2: warning: 'val' may be used