Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-26 Thread Russell King - ARM Linux
On Sat, Jan 26, 2013 at 06:03:28PM +0800, Mark Brown wrote: > On Sat, Jan 26, 2013 at 09:59:16AM +, Russell King - ARM Linux wrote: > > > Why not code the function in a way that avoids the problem altogether? > > That'd do the trick too; feel free to submit a patch... Sorry, got other

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-26 Thread Mark Brown
On Sat, Jan 26, 2013 at 09:59:16AM +, Russell King - ARM Linux wrote: > Why not code the function in a way that avoids the problem altogether? That'd do the trick too; feel free to submit a patch... signature.asc Description: Digital signature

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-26 Thread Russell King - ARM Linux
On Sat, Jan 26, 2013 at 05:49:29PM +0800, Mark Brown wrote: > Oh, ffs. This is a false positive from the compiler - there is no case > where it can actually do this as we will bail out before the walk if the > list is empty so we'll always take at least one trip through our >

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-26 Thread Mark Brown
On Sat, Jan 26, 2013 at 09:17:27AM +, Arnd Bergmann wrote: > On Saturday 26 January 2013, Mark Brown wrote: > > On Fri, Jan 25, 2013 at 02:14:28PM +, Arnd Bergmann wrote: > > > Gcc warns about the case where regmap_read_debugfs tries > > Are you sure about that function name? > Yes,

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-26 Thread Arnd Bergmann
On Saturday 26 January 2013, Mark Brown wrote: > On Fri, Jan 25, 2013 at 02:14:28PM +, Arnd Bergmann wrote: > > Gcc warns about the case where regmap_read_debugfs tries > > Are you sure about that function name? Yes, regmap_read_debugfs uses the return value from

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-26 Thread Arnd Bergmann
On Saturday 26 January 2013, Mark Brown wrote: On Fri, Jan 25, 2013 at 02:14:28PM +, Arnd Bergmann wrote: Gcc warns about the case where regmap_read_debugfs tries Are you sure about that function name? Yes, regmap_read_debugfs uses the return value from regmap_debugfs_get_dump_start,

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-26 Thread Mark Brown
On Sat, Jan 26, 2013 at 09:17:27AM +, Arnd Bergmann wrote: On Saturday 26 January 2013, Mark Brown wrote: On Fri, Jan 25, 2013 at 02:14:28PM +, Arnd Bergmann wrote: Gcc warns about the case where regmap_read_debugfs tries Are you sure about that function name? Yes,

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-26 Thread Russell King - ARM Linux
On Sat, Jan 26, 2013 at 05:49:29PM +0800, Mark Brown wrote: Oh, ffs. This is a false positive from the compiler - there is no case where it can actually do this as we will bail out before the walk if the list is empty so we'll always take at least one trip through our list_for_each_entry()

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-26 Thread Mark Brown
On Sat, Jan 26, 2013 at 09:59:16AM +, Russell King - ARM Linux wrote: Why not code the function in a way that avoids the problem altogether? That'd do the trick too; feel free to submit a patch... signature.asc Description: Digital signature

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-26 Thread Russell King - ARM Linux
On Sat, Jan 26, 2013 at 06:03:28PM +0800, Mark Brown wrote: On Sat, Jan 26, 2013 at 09:59:16AM +, Russell King - ARM Linux wrote: Why not code the function in a way that avoids the problem altogether? That'd do the trick too; feel free to submit a patch... Sorry, got other things

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-25 Thread Mark Brown
On Sat, Jan 26, 2013 at 12:42:26PM +0800, Mark Brown wrote: > On Fri, Jan 25, 2013 at 02:14:28PM +, Arnd Bergmann wrote: > > Gcc warns about the case where regmap_read_debugfs tries > Are you sure about that function name? > > to walk an empty map->debugfs_off_cache list, which results > >

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-25 Thread Mark Brown
On Fri, Jan 25, 2013 at 02:14:28PM +, Arnd Bergmann wrote: > Gcc warns about the case where regmap_read_debugfs tries Are you sure about that function name? > to walk an empty map->debugfs_off_cache list, which results > in uninitialized variable getting returned. > Setting this variable to

[PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-25 Thread Arnd Bergmann
Gcc warns about the case where regmap_read_debugfs tries to walk an empty map->debugfs_off_cache list, which results in uninitialized variable getting returned. Setting this variable to 0 first avoids the warning and the potentially undefined value. Without this patch, building mxs_defconfig

[PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-25 Thread Arnd Bergmann
Gcc warns about the case where regmap_read_debugfs tries to walk an empty map->debugfs_off_cache list, which results in uninitialized variable getting returned. Setting this variable to 0 first avoids the warning and the potentially undefined value. Without this patch, building mxs_defconfig

[PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-25 Thread Arnd Bergmann
Gcc warns about the case where regmap_read_debugfs tries to walk an empty map-debugfs_off_cache list, which results in uninitialized variable getting returned. Setting this variable to 0 first avoids the warning and the potentially undefined value. Without this patch, building mxs_defconfig

[PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-25 Thread Arnd Bergmann
Gcc warns about the case where regmap_read_debugfs tries to walk an empty map-debugfs_off_cache list, which results in uninitialized variable getting returned. Setting this variable to 0 first avoids the warning and the potentially undefined value. Without this patch, building mxs_defconfig

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-25 Thread Mark Brown
On Fri, Jan 25, 2013 at 02:14:28PM +, Arnd Bergmann wrote: Gcc warns about the case where regmap_read_debugfs tries Are you sure about that function name? to walk an empty map-debugfs_off_cache list, which results in uninitialized variable getting returned. Setting this variable to 0

Re: [PATCH 11/19] regmap: avoid undefined return from regmap_read_debugfs

2013-01-25 Thread Mark Brown
On Sat, Jan 26, 2013 at 12:42:26PM +0800, Mark Brown wrote: On Fri, Jan 25, 2013 at 02:14:28PM +, Arnd Bergmann wrote: Gcc warns about the case where regmap_read_debugfs tries Are you sure about that function name? to walk an empty map-debugfs_off_cache list, which results in