Skip to content

Commit

Permalink
AVR32: Fix thinko in generic_find_next_zero_le_bit()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Haavard Skinnemoen committed Nov 6, 2006
1 parent e9a4385 commit 168c8fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/avr32/lib/findbit.S
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 168c8fa

Please sign in to comment.