Skip to content

Commit

Permalink
mm/zsmalloc.c: change stat type parameter to int
Browse files Browse the repository at this point in the history
zs_stat_inc/dec/get() uses enum zs_stat_type for the stat type, however
some callers pass an enum fullness_group value.  Change the type to int to
reflect the actual use of the functions and get rid of 'enum-conversion'
warnings

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthias Kaehlcke <[email protected]>
Reviewed-by: Sergey Senozhatsky <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Cc: Doug Anderson <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Matthias Kaehlcke authored and torvalds committed Sep 9, 2017
1 parent 9472f23 commit 3eb95fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mm/zsmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,20 +551,23 @@ static int get_size_class_index(int size)
return min_t(int, ZS_SIZE_CLASSES - 1, idx);
}

/* type can be of enum type zs_stat_type or fullness_group */
static inline void zs_stat_inc(struct size_class *class,
enum zs_stat_type type, unsigned long cnt)
int type, unsigned long cnt)
{
class->stats.objs[type] += cnt;
}

/* type can be of enum type zs_stat_type or fullness_group */
static inline void zs_stat_dec(struct size_class *class,
enum zs_stat_type type, unsigned long cnt)
int type, unsigned long cnt)
{
class->stats.objs[type] -= cnt;
}

/* type can be of enum type zs_stat_type or fullness_group */
static inline unsigned long zs_stat_get(struct size_class *class,
enum zs_stat_type type)
int type)
{
return class->stats.objs[type];
}
Expand Down

0 comments on commit 3eb95fe

Please sign in to comment.