Skip to content

Commit

Permalink
mm/zbud: change zbud_alloc size type to size_t
Browse files Browse the repository at this point in the history
Change the type of the zbud_alloc() size param from unsigned int to
size_t.

Technically, this should not make any difference, as the zbud
implementation already restricts the size to well within either type's
limits; but as zsmalloc (and kmalloc) use size_t, and zpool will use
size_t, this brings the size parameter type in line with zsmalloc/zpool.

Signed-off-by: Dan Streetman <[email protected]>
Acked-by: Seth Jennings <[email protected]>
Tested-by: Seth Jennings <[email protected]>
Cc: Weijie Yang <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Nitin Gupta <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
ddstreet authored and torvalds committed Aug 7, 2014
1 parent d2d5e76 commit 99eef8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/linux/zbud.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct zbud_ops {

struct zbud_pool *zbud_create_pool(gfp_t gfp, struct zbud_ops *ops);
void zbud_destroy_pool(struct zbud_pool *pool);
int zbud_alloc(struct zbud_pool *pool, unsigned int size, gfp_t gfp,
int zbud_alloc(struct zbud_pool *pool, size_t size, gfp_t gfp,
unsigned long *handle);
void zbud_free(struct zbud_pool *pool, unsigned long handle);
int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries);
Expand Down
4 changes: 2 additions & 2 deletions mm/zbud.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ enum buddy {
};

/* Converts an allocation size in bytes to size in zbud chunks */
static int size_to_chunks(int size)
static int size_to_chunks(size_t size)
{
return (size + CHUNK_SIZE - 1) >> CHUNK_SHIFT;
}
Expand Down Expand Up @@ -247,7 +247,7 @@ void zbud_destroy_pool(struct zbud_pool *pool)
* gfp arguments are invalid or -ENOMEM if the pool was unable to allocate
* a new page.
*/
int zbud_alloc(struct zbud_pool *pool, unsigned int size, gfp_t gfp,
int zbud_alloc(struct zbud_pool *pool, size_t size, gfp_t gfp,
unsigned long *handle)
{
int chunks, i, freechunks;
Expand Down

0 comments on commit 99eef8e

Please sign in to comment.