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); } _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"