Skip to content

Commit a221b5f

Browse files
Huang Shijiesfrothwell
authored andcommitted
lib/genalloc.c: change return type to unsigned long for bitmap_set_ll
Just as bitmap_clear_ll(), change return type to unsigned long for bitmap_set_ll to avoid the possible overflow in future. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Huang Shijie <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Stephen Rothwell <[email protected]>
1 parent 7b63459 commit a221b5f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/genalloc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ static int clear_bits_ll(unsigned long *addr, unsigned long mask_to_clear)
8181
* users set the same bit, one user will return remain bits, otherwise
8282
* return 0.
8383
*/
84-
static int bitmap_set_ll(unsigned long *map, unsigned long start, unsigned long nr)
84+
static unsigned long
85+
bitmap_set_ll(unsigned long *map, unsigned long start, unsigned long nr)
8586
{
8687
unsigned long *p = map + BIT_WORD(start);
8788
const unsigned long size = start + nr;

0 commit comments

Comments
 (0)