diff options
author | 2014-02-09 13:13:45 +0100 | |
---|---|---|
committer | 2014-02-09 13:13:45 +0100 | |
commit | 3c3d7cb1db4af176dab843f22ea092a4ef1eb989 (patch) | |
tree | 9c1b2951432ed10d0654a8e13cbe57b51260d06b /lib/flex_array.c | |
parent | perf/x86: Fix Userspace RDPMC switch (diff) | |
parent | Merge tag 'pinctrl-v3.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl (diff) | |
download | linux-dev-3c3d7cb1db4af176dab843f22ea092a4ef1eb989.tar.xz linux-dev-3c3d7cb1db4af176dab843f22ea092a4ef1eb989.zip |
Merge branch 'linus' into perf/core
Refresh the branch to a v3.14-rc base before queueing up new devel patches.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib/flex_array.c')
-rw-r--r-- | lib/flex_array.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/flex_array.c b/lib/flex_array.c index 6948a6692fc4..2eed22fa507c 100644 --- a/lib/flex_array.c +++ b/lib/flex_array.c @@ -90,8 +90,8 @@ struct flex_array *flex_array_alloc(int element_size, unsigned int total, { struct flex_array *ret; int elems_per_part = 0; - int reciprocal_elems = 0; int max_size = 0; + struct reciprocal_value reciprocal_elems = { 0 }; if (element_size) { elems_per_part = FLEX_ARRAY_ELEMENTS_PER_PART(element_size); @@ -119,6 +119,11 @@ EXPORT_SYMBOL(flex_array_alloc); static int fa_element_to_part_nr(struct flex_array *fa, unsigned int element_nr) { + /* + * if element_size == 0 we don't get here, so we never touch + * the zeroed fa->reciprocal_elems, which would yield invalid + * results + */ return reciprocal_divide(element_nr, fa->reciprocal_elems); } |