aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2014-11-03 10:13:33 -0500
committerMark Brown <broonie@kernel.org>2014-11-03 10:13:33 -0500
commitebc01f593b58e1896150fc2e3cbdd0116323c52c (patch)
tree23e905a3fdbee3fc8a66ef760b9ed5ef5455e9dd /lib
parent3f7256fe5fc64132a2dd19695255c990aa2188cf (diff)
parent0df1f2487d2f0d04703f142813d53615d62a1da4 (diff)
Merge tag 'v3.18-rc3' into asoc-sgtl5000
Linux 3.18-rc3
Diffstat (limited to 'lib')
-rw-r--r--lib/bitmap.c8
-rw-r--r--lib/scatterlist.c6
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c
index cd250a2e14cb..b499ab6ada29 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -131,7 +131,9 @@ void __bitmap_shift_right(unsigned long *dst,
131 lower = src[off + k]; 131 lower = src[off + k];
132 if (left && off + k == lim - 1) 132 if (left && off + k == lim - 1)
133 lower &= mask; 133 lower &= mask;
134 dst[k] = upper << (BITS_PER_LONG - rem) | lower >> rem; 134 dst[k] = lower >> rem;
135 if (rem)
136 dst[k] |= upper << (BITS_PER_LONG - rem);
135 if (left && k == lim - 1) 137 if (left && k == lim - 1)
136 dst[k] &= mask; 138 dst[k] &= mask;
137 } 139 }
@@ -172,7 +174,9 @@ void __bitmap_shift_left(unsigned long *dst,
172 upper = src[k]; 174 upper = src[k];
173 if (left && k == lim - 1) 175 if (left && k == lim - 1)
174 upper &= (1UL << left) - 1; 176 upper &= (1UL << left) - 1;
175 dst[k + off] = lower >> (BITS_PER_LONG - rem) | upper << rem; 177 dst[k + off] = upper << rem;
178 if (rem)
179 dst[k + off] |= lower >> (BITS_PER_LONG - rem);
176 if (left && k + off == lim - 1) 180 if (left && k + off == lim - 1)
177 dst[k + off] &= (1UL << left) - 1; 181 dst[k + off] &= (1UL << left) - 1;
178 } 182 }
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 9cdf62f8accd..c9f2e8c6ccc9 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -203,10 +203,10 @@ void __sg_free_table(struct sg_table *table, unsigned int max_ents,
203 } 203 }
204 204
205 table->orig_nents -= sg_size; 205 table->orig_nents -= sg_size;
206 if (!skip_first_chunk) { 206 if (skip_first_chunk)
207 free_fn(sgl, alloc_size);
208 skip_first_chunk = false; 207 skip_first_chunk = false;
209 } 208 else
209 free_fn(sgl, alloc_size);
210 sgl = next; 210 sgl = next;
211 } 211 }
212 212