Author: hselasky
Date: Thu Apr  7 07:45:31 2016
New Revision: 297657
URL: https://svnweb.freebsd.org/changeset/base/297657

Log:
  MFC r297444:
  Fix bugs in currently unused bit searching loop.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/9/sys/ofed/include/linux/bitops.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ofed/include/linux/bitops.h
==============================================================================
--- stable/9/sys/ofed/include/linux/bitops.h    Thu Apr  7 07:44:01 2016        
(r297656)
+++ stable/9/sys/ofed/include/linux/bitops.h    Thu Apr  7 07:45:31 2016        
(r297657)
@@ -138,11 +138,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-stable-9@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to