Skip to content

Commit

Permalink
kmemleak: use bool for true/false questions
Browse files Browse the repository at this point in the history
Acked-by: Pekka Enberg <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
  • Loading branch information
Luis R. Rodriguez authored and ctmarinas committed Sep 8, 2009
1 parent 179a810 commit 4a558dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mm/kmemleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,17 +308,17 @@ static void hex_dump_object(struct seq_file *seq,
* Newly created objects don't have any color assigned (object->count == -1)
* before the next memory scan when they become white.
*/
static int color_white(const struct kmemleak_object *object)
static bool color_white(const struct kmemleak_object *object)
{
return object->count != -1 && object->count < object->min_count;
}

static int color_gray(const struct kmemleak_object *object)
static bool color_gray(const struct kmemleak_object *object)
{
return object->min_count != -1 && object->count >= object->min_count;
}

static int color_black(const struct kmemleak_object *object)
static bool color_black(const struct kmemleak_object *object)
{
return object->min_count == -1;
}
Expand All @@ -328,7 +328,7 @@ static int color_black(const struct kmemleak_object *object)
* not be deleted and have a minimum age to avoid false positives caused by
* pointers temporarily stored in CPU registers.
*/
static int unreferenced_object(struct kmemleak_object *object)
static bool unreferenced_object(struct kmemleak_object *object)
{
return (object->flags & OBJECT_ALLOCATED) && color_white(object) &&
time_before_eq(object->jiffies + jiffies_min_age,
Expand Down

0 comments on commit 4a558dd

Please sign in to comment.