summaryrefslogtreecommitdiff
path: root/arch/avr32/lib
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2006-10-31 22:01:11 +0300
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2006-11-06 12:43:24 +0300
commit168c8fa32ff40d6caf7226a5abf2a0096f3393bf (patch)
treeb58f6a66a4325e83482cbc43d88fae7c9ee1054a /arch/avr32/lib
parente9a43850e6a99e335c8120579749389b376bc204 (diff)
downloadlinux-168c8fa32ff40d6caf7226a5abf2a0096f3393bf.tar.xz
AVR32: Fix thinko in generic_find_next_zero_le_bit()
The existing implementation of this function seems to be looking for a one although it should be looking for a zero. This causes trouble for the ext2 filesystem, which tends to report -ENOSPC without this patch. Fix this by complementing each word before scanning. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/lib')
-rw-r--r--arch/avr32/lib/findbit.S3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/avr32/lib/findbit.S b/arch/avr32/lib/findbit.S
index 2b4856f4bf7c..c6b91dee857c 100644
--- a/arch/avr32/lib/findbit.S
+++ b/arch/avr32/lib/findbit.S
@@ -136,6 +136,7 @@ ENTRY(generic_find_next_zero_le_bit)
/* offset is not word-aligned. Handle the first (32 - r10) bits */
ldswp.w r8, r12[0]
sub r12, -4
+ com r8
lsr r8, r8, r10
brne .L_found
@@ -146,7 +147,7 @@ ENTRY(generic_find_next_zero_le_bit)
/* Main loop. offset must be word-aligned */
1: ldswp.w r8, r12[0]
- cp.w r8, 0
+ com r8
brne .L_found
sub r12, -4
sub r9, 32