aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-m68knommu
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2006-01-10 02:00:39 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 12:31:27 -0500
commit3960f2faaf0a67ad352bd5d4085e43f19f33ab91 (patch)
treebfd8766845324c6da4be7886907865c451addf26 /include/asm-m68knommu
parent845884d332c060b0dfc54ba5a580d0f1a99c58a2 (diff)
[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: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-m68knommu')
-rw-r--r--include/asm-m68knommu/bitops.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asm-m68knommu/bitops.h b/include/asm-m68knommu/bitops.h
index 4058dd086a02..25d8a3cfef90 100644
--- a/include/asm-m68knommu/bitops.h
+++ b/include/asm-m68knommu/bitops.h
@@ -290,7 +290,7 @@ static __inline__ int find_next_zero_bit (const void * addr, int size, int offse
290 tmp = *p; 290 tmp = *p;
291 291
292found_first: 292found_first:
293 tmp |= ~0UL >> size; 293 tmp |= ~0UL << size;
294found_middle: 294found_middle:
295 return result + ffz(tmp); 295 return result + ffz(tmp);
296} 296}