Skip to contentSkip to conversation

trivial type cast clean up for find_next_zero_bit

PATCH New Ken Chen 1 participant 1 message Feb 21, 2007 Bitops API

lore
Share & tools
lore

Ken Chen

author
#0 lore raw

PATCH 1/1 trivial type cast clean up for find_next_zero_bit

clean up unneeded type cast by properly declare data type.

arch/i386/lib/bitops.c +0 -0
index 97db385..afd0045 100644
@@ -43,7 +43,7 @@ EXPORT_SYMBOL(find_next_bit);
 */

int find_next_zero_bit(const unsigned long *addr, int size, int offset) {
- unsigned long * p = ((unsigned long *) addr) + (offset >> 5);

+	const unsigned long *p = addr + (offset >> 5);
	int set = 0, bit = offset & 31, res;

	if (bit) {
@@ -64,7 +64,7 @@ int find_next_zero_bit(const unsigned lo
	/*
	 * No zero yet, search remaining full bytes for a zero
	 */
-	res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr));
+	res = find_first_zero_bit(p, size - 32 * (p - addr));
	return (offset + set + res);
}

EXPORT_SYMBOL(find_next_zero_bit);