diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2014-02-07 14:27:30 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2014-02-07 14:27:30 -0500 |
commit | a3b072cd180c12e8fe0ece9487b9065808327640 (patch) | |
tree | 62b982041be84748852d77cdf6ca5639ef40858f /lib/flex_array.c | |
parent | 75a1ba5b2c529db60ca49626bcaf0bddf4548438 (diff) | |
parent | 081cd62a010f97b5bc1d2b0cd123c5abc692b68a (diff) |
Merge tag 'efi-urgent' into x86/urgent
* Avoid WARN_ON() when mapping BGRT on Baytrail (EFI 32-bit).
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
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, | |||
90 | { | 90 | { |
91 | struct flex_array *ret; | 91 | struct flex_array *ret; |
92 | int elems_per_part = 0; | 92 | int elems_per_part = 0; |
93 | int reciprocal_elems = 0; | ||
94 | int max_size = 0; | 93 | int max_size = 0; |
94 | struct reciprocal_value reciprocal_elems = { 0 }; | ||
95 | 95 | ||
96 | if (element_size) { | 96 | if (element_size) { |
97 | elems_per_part = FLEX_ARRAY_ELEMENTS_PER_PART(element_size); | 97 | elems_per_part = FLEX_ARRAY_ELEMENTS_PER_PART(element_size); |
@@ -119,6 +119,11 @@ EXPORT_SYMBOL(flex_array_alloc); | |||
119 | static int fa_element_to_part_nr(struct flex_array *fa, | 119 | static int fa_element_to_part_nr(struct flex_array *fa, |
120 | unsigned int element_nr) | 120 | unsigned int element_nr) |
121 | { | 121 | { |
122 | /* | ||
123 | * if element_size == 0 we don't get here, so we never touch | ||
124 | * the zeroed fa->reciprocal_elems, which would yield invalid | ||
125 | * results | ||
126 | */ | ||
122 | return reciprocal_divide(element_nr, fa->reciprocal_elems); | 127 | return reciprocal_divide(element_nr, fa->reciprocal_elems); |
123 | } | 128 | } |
124 | 129 | ||