提交 3960f2fa 编写于 作者: G Greg Ungerer 提交者: Linus Torvalds

[PATCH] m68knommu: fix find_next_zero_bit in bitops.h

We're starting a number of big applications (memory footprint app.
1MByte) on our Arcturus uC5272.  Therefore memory fragmentation is a
real pain for us.  We've switched to uClinux-2.4.27-uc1 and found that
page_alloc2 fragments the memory heavily.

Digging into it we found a bug in the find_next_zero_bit function in the
m68knommu/bitops.h file.  if the size isn't a multiple of 32 than the
upper bits of the last word to be searched should be masked.  But the
functions masks the lower bits of the last word because it uses a right
shift instead of a left shift operator.

Patch submitted by Sascha Smejkal <s.smejkal@centersystems.at>
Signed-off-by: NGreg Ungerer <gerg@uclinux.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 845884d3
......@@ -290,7 +290,7 @@ static __inline__ int find_next_zero_bit (const void * addr, int size, int offse
tmp = *p;
found_first:
tmp |= ~0UL >> size;
tmp |= ~0UL << size;
found_middle:
return result + ffz(tmp);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册