<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib/bitmap.c, branch v3.17</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-08-07T01:01:27Z</updated>
<entry>
<title>lib: bitmap: add missing mask in bitmap_andnot</title>
<updated>2014-08-07T01:01:27Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-08-06T23:10:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=74e765319084bd2940a9612ada961f0f7385936c'/>
<id>urn:sha1:74e765319084bd2940a9612ada961f0f7385936c</id>
<content type='text'>
Apparently, bitmap_andnot is supposed to return whether the new bitmap
is empty.  But it didn't take potential garbage bits in the last word
into account.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: bitmap: add missing mask in bitmap_and</title>
<updated>2014-08-07T01:01:27Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-08-06T23:10:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7e5f97d1927f41affa21aa5b321865ceab1994ce'/>
<id>urn:sha1:7e5f97d1927f41affa21aa5b321865ceab1994ce</id>
<content type='text'>
Apparently, bitmap_and is supposed to return whether the new bitmap is
empty.  But it didn't take potential garbage bits in the last word into
account.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: bitmap: micro-optimize bitmap_allocate_region</title>
<updated>2014-08-07T01:01:26Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-08-06T23:10:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2ac521d3325a24f01c1f1e86c74537b831d282c5'/>
<id>urn:sha1:2ac521d3325a24f01c1f1e86c74537b831d282c5</id>
<content type='text'>
__reg_op(..., REG_OP_ALLOC) always returns 0, so we might as well use that
and save an instruction.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: bitmap: change parameter of bitmap_*_region to unsigned</title>
<updated>2014-08-07T01:01:26Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-08-06T23:10:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9279d3286e10736766edcaf815ae10e00856e448'/>
<id>urn:sha1:9279d3286e10736766edcaf815ae10e00856e448</id>
<content type='text'>
Changing the pos parameter of __reg_op to unsigned allows the compiler
to generate slightly smaller and simpler code.  Also update its callers
bitmap_*_region to receive and pass unsigned int.  The return types of
bitmap_find_free_region and bitmap_allocate_region are still int to
allow a negative error code to be returned.  An int is certainly capable
of representing any realistic return value.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: bitmap: fix typo in kerneldoc for bitmap_pos_to_ord</title>
<updated>2014-08-07T01:01:26Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-08-06T23:10:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a855174878f06d197ddfde5cbe1e69a1d4a2df27'/>
<id>urn:sha1:a855174878f06d197ddfde5cbe1e69a1d4a2df27</id>
<content type='text'>
A few lines above, it was stated that positions for non-set bits are
mapped to -1, which is obviously also what the code does.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: bitmap: simplify bitmap_parselist</title>
<updated>2014-08-07T01:01:26Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-08-06T23:10:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bc5be1828065681300f3727ab55fac0d7ef37af3'/>
<id>urn:sha1:bc5be1828065681300f3727ab55fac0d7ef37af3</id>
<content type='text'>
We want len to be the index of the first '\n', or the length of the
string if there is no newline.  This is a good example of the usefulness
of strchrnul().  Use that instead, thus eliminating a branch and a call
to strlen().

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: bitmap: make the start index of bitmap_clear unsigned</title>
<updated>2014-08-07T01:01:26Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-08-06T23:10:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=154f5e38f30f262025c8c2e825376f6eb51e8bcb'/>
<id>urn:sha1:154f5e38f30f262025c8c2e825376f6eb51e8bcb</id>
<content type='text'>
The compiler can generate slightly smaller and simpler code when it
knows that "start" is non-negative.

Also, use the names "start" and "len" for the two parameters for
consistency with bitmap_set.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: bitmap: make the start index of bitmap_set unsigned</title>
<updated>2014-08-07T01:01:26Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-08-06T23:10:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fb5ac54263ef3fcb5c469a61e0ab6b06e45e2307'/>
<id>urn:sha1:fb5ac54263ef3fcb5c469a61e0ab6b06e45e2307</id>
<content type='text'>
The compiler can generate slightly smaller and simpler code when it
knows that "start" is non-negative.

Also, use the names "start" and "len" for the two parameters in both
header file and implementation, instead of the previous mix.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: bitmap: make nbits parameter of bitmap_weight unsigned</title>
<updated>2014-08-07T01:01:26Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-08-06T23:10:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=877d9f3b63ac2e5dbc51cbcdff156433f03b3a32'/>
<id>urn:sha1:877d9f3b63ac2e5dbc51cbcdff156433f03b3a32</id>
<content type='text'>
The compiler can generate slightly smaller and simpler code when it
knows that "nbits" is non-negative.  Since no-one passes a negative
bit-count, this shouldn't affect the semantics.

I didn't change the return type, since that might change the semantics
of some expression containing a call to bitmap_weight(). Certainly an
int is capable of holding the result.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: bitmap: make nbits parameter of bitmap_subset unsigned</title>
<updated>2014-08-07T01:01:26Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2014-08-06T23:10:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5be20213e855550de2b32fde6fc116f74bab86a6'/>
<id>urn:sha1:5be20213e855550de2b32fde6fc116f74bab86a6</id>
<content type='text'>
The compiler can generate slightly smaller and simpler code when it
knows that "nbits" is non-negative.  Since no-one passes a negative
bit-count, this shouldn't affect the semantics.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
