Messages in this thread | | | Date | Tue, 22 Jan 2013 11:07:04 +0100 | From | Vincent Stehlé <> | Subject | Re: [PATCH] regmap: debugfs: Fix compilation warning |
| |
On 01/22/2013 07:41 AM, Mark Brown wrote: (..) > This sort of fix is not a good idea, you're just shutting the > warning up without any sort of analysis explaining why it's > generated in error. If it's generating a spurious error that's a > compiler bug.
In the regmap_debugfs_get_dump_start() function control flow, I think the compiler cannot know for sure that the list_for_each_entry() iterates at least once.:
regmap_debugfs_get_dump_start() { unsigned int ret; <snip some code, which does not touch ret>
list_for_each_entry() { <snip some code> ret = <value>; }
return ret; }
Do you think there is a way to "mark" the list_for_each_entry() as iterating at least once? an __attribute__ maybe?
Best regards,
V.
| |