svn commit: r297444 - head/sys/compat/linuxkpi/common/include/linux
Hans Petter Selasky
hselasky at FreeBSD.org
Thu Mar 31 06:19:17 UTC 2016
Author: hselasky
Date: Thu Mar 31 06:19:15 2016
New Revision: 297444
URL: https://svnweb.freebsd.org/changeset/base/297444
Log:
Fix bugs in currently unused bit searching loop.
MFC after: 3 days
Sponsored by: Mellanox Technologies
Modified:
head/sys/compat/linuxkpi/common/include/linux/bitops.h
Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/bitops.h Thu Mar 31 04:57:38 2016 (r297443)
+++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Thu Mar 31 06:19:15 2016 (r297444)
@@ -147,11 +147,11 @@ find_last_bit(unsigned long *addr, unsig
if (mask)
return (bit + __flsl(mask));
}
- while (--pos) {
+ while (pos--) {
addr--;
bit -= BITS_PER_LONG;
if (*addr)
- return (bit + __flsl(mask));
+ return (bit + __flsl(*addr));
}
return (size);
}
More information about the svn-src-all
mailing list