mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
powerpc/mm/slice: Remove intermediate bitmap copy
bitmap_or() and bitmap_andnot() can work properly with dst identical to src1 or src2. There is no need of an intermediate result bitmap that is copied back to dst in a second step. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
51d42f0f5f
commit
326691ad4f
1 changed files with 4 additions and 8 deletions
|
@ -388,21 +388,17 @@ static unsigned long slice_find_area(struct mm_struct *mm, unsigned long len,
|
||||||
|
|
||||||
static inline void slice_or_mask(struct slice_mask *dst, struct slice_mask *src)
|
static inline void slice_or_mask(struct slice_mask *dst, struct slice_mask *src)
|
||||||
{
|
{
|
||||||
DECLARE_BITMAP(result, SLICE_NUM_HIGH);
|
|
||||||
|
|
||||||
dst->low_slices |= src->low_slices;
|
dst->low_slices |= src->low_slices;
|
||||||
bitmap_or(result, dst->high_slices, src->high_slices, SLICE_NUM_HIGH);
|
bitmap_or(dst->high_slices, dst->high_slices, src->high_slices,
|
||||||
bitmap_copy(dst->high_slices, result, SLICE_NUM_HIGH);
|
SLICE_NUM_HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void slice_andnot_mask(struct slice_mask *dst, struct slice_mask *src)
|
static inline void slice_andnot_mask(struct slice_mask *dst, struct slice_mask *src)
|
||||||
{
|
{
|
||||||
DECLARE_BITMAP(result, SLICE_NUM_HIGH);
|
|
||||||
|
|
||||||
dst->low_slices &= ~src->low_slices;
|
dst->low_slices &= ~src->low_slices;
|
||||||
|
|
||||||
bitmap_andnot(result, dst->high_slices, src->high_slices, SLICE_NUM_HIGH);
|
bitmap_andnot(dst->high_slices, dst->high_slices, src->high_slices,
|
||||||
bitmap_copy(dst->high_slices, result, SLICE_NUM_HIGH);
|
SLICE_NUM_HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PPC_64K_PAGES
|
#ifdef CONFIG_PPC_64K_PAGES
|
||||||
|
|
Loading…
Reference in a new issue