Do not incorrectly add the low 5 bits of the offset to the resulting

position of the found zero bit.

Submitted by:	Jaakko Heinonen <jh saunalahti fi>
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2009-01-04 15:56:49 +00:00
parent 63a07fdbc0
commit 178e776169
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=186740

View File

@ -84,7 +84,7 @@ find_next_zero_bit(void *data, size_t sz, size_t ofs)
mask = ~0U << (ofs & 31);
bit = *p | ~mask;
if (bit != ~0U)
return (ffs(~bit) + ofs - 1);
return (ffs(~bit) + (ofs & ~31U) - 1);
p++;
ofs = (ofs + 31U) & ~31U;
}