瀏覽代碼

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>
Haavard Skinnemoen 18 年之前
父節點
當前提交
168c8fa32f
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      arch/avr32/lib/findbit.S

+ 2 - 1
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 */
 	/* offset is not word-aligned. Handle the first (32 - r10) bits */
 	ldswp.w	r8, r12[0]
 	ldswp.w	r8, r12[0]
 	sub	r12, -4
 	sub	r12, -4
+	com	r8
 	lsr	r8, r8, r10
 	lsr	r8, r8, r10
 	brne	.L_found
 	brne	.L_found
 
 
@@ -146,7 +147,7 @@ ENTRY(generic_find_next_zero_le_bit)
 
 
 	/* Main loop. offset must be word-aligned */
 	/* Main loop. offset must be word-aligned */
 1:	ldswp.w	r8, r12[0]
 1:	ldswp.w	r8, r12[0]
-	cp.w	r8, 0
+	com	r8
 	brne	.L_found
 	brne	.L_found
 	sub	r12, -4
 	sub	r12, -4
 	sub	r9, 32
 	sub	r9, 32