hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/arm/lib/findbit.S
....@@ -1,11 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * linux/arch/arm/lib/findbit.S
34 *
45 * Copyright (C) 1995-2000 Russell King
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 *
107 * 16th March 2001 - John Ripley <jripley@sonicblue.com>
118 * Fixed so that "size" is an exclusive not an inclusive quantity.
....@@ -43,8 +40,8 @@
4340 * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
4441 */
4542 ENTRY(_find_next_zero_bit_le)
46
- teq r1, #0
47
- beq 3b
43
+ cmp r2, r1
44
+ bhs 3b
4845 ands ip, r2, #7
4946 beq 1b @ If new byte, goto old routine
5047 ARM( ldrb r3, [r0, r2, lsr #3] )
....@@ -84,8 +81,8 @@
8481 * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
8582 */
8683 ENTRY(_find_next_bit_le)
87
- teq r1, #0
88
- beq 3b
84
+ cmp r2, r1
85
+ bhs 3b
8986 ands ip, r2, #7
9087 beq 1b @ If new byte, goto old routine
9188 ARM( ldrb r3, [r0, r2, lsr #3] )
....@@ -118,8 +115,8 @@
118115 ENDPROC(_find_first_zero_bit_be)
119116
120117 ENTRY(_find_next_zero_bit_be)
121
- teq r1, #0
122
- beq 3b
118
+ cmp r2, r1
119
+ bhs 3b
123120 ands ip, r2, #7
124121 beq 1b @ If new byte, goto old routine
125122 eor r3, r2, #0x18 @ big endian byte ordering
....@@ -152,8 +149,8 @@
152149 ENDPROC(_find_first_bit_be)
153150
154151 ENTRY(_find_next_bit_be)
155
- teq r1, #0
156
- beq 3b
152
+ cmp r2, r1
153
+ bhs 3b
157154 ands ip, r2, #7
158155 beq 1b @ If new byte, goto old routine
159156 eor r3, r2, #0x18 @ big endian byte ordering