]> err.no Git - linux-2.6/commitdiff
AVR32: Fix thinko in generic_find_next_zero_le_bit()
authorHaavard Skinnemoen <hskinnemoen@atmel.com>
Tue, 31 Oct 2006 19:01:11 +0000 (20:01 +0100)
committerHaavard Skinnemoen <hskinnemoen@atmel.com>
Mon, 6 Nov 2006 09:43:24 +0000 (10:43 +0100)
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>
arch/avr32/lib/findbit.S

index 2b4856f4bf7c697f0dbaaae2c329c5f65e00ffe7..c6b91dee857c822c507764e1c2a054a3ee02a5ba 100644 (file)
@@ -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