[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] One more bugfix for xfs_lowbit64




(mea culpa). The error return was broken too, it would return -2,
not -1 for errors. Makes no difference in the callers, they never check
for -1, but is still better to conform to the spec.

Includes the previous fix for bits > 32.

-Andi

--- linux-2.6.0test3/fs/xfs/xfs_bit.c-o	2003-05-27 03:00:41.000000000 +0200
+++ linux-2.6.0test3/fs/xfs/xfs_bit.c	2003-08-22 22:08:14.000000000 +0200
@@ -156,12 +156,12 @@
 {
 	int n;
 	n = ffs((unsigned)v);
-	if (n == 0) {
+	if (n < 0) {
 		n = ffs(v >> 32);
 		if (n >= 0)
 			n+=32;
 	}
-	return n-1;
+	return (n < 0) ? n : n-1;
 }
 
 /*