diff options
author | hselasky <hselasky@FreeBSD.org> | 2016-04-07 07:44:01 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2016-04-07 07:44:01 +0000 |
commit | 206a1c6d9880e4552bd6091a78fd05c882f431c9 (patch) | |
tree | 1a2035740dde091d7af294c3d22faa64d0a2c2fc /sys/ofed | |
parent | 9706ffd556695ddcbcd7adedc7e67f1021081a6c (diff) | |
download | FreeBSD-src-206a1c6d9880e4552bd6091a78fd05c882f431c9.zip FreeBSD-src-206a1c6d9880e4552bd6091a78fd05c882f431c9.tar.gz |
MFC r297444:
Fix bugs in currently unused bit searching loop.
Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/ofed')
-rw-r--r-- | sys/ofed/include/linux/bitops.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ofed/include/linux/bitops.h b/sys/ofed/include/linux/bitops.h index d3f82fe..bc8cc7b 100644 --- a/sys/ofed/include/linux/bitops.h +++ b/sys/ofed/include/linux/bitops.h @@ -138,11 +138,11 @@ find_last_bit(unsigned long *addr, unsigned long size) 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); } |