zram: use size_t instead of u16

Some architectures (eg, hexagon and PowerPC) could use PAGE_SHIFT of 16
or more.  In these cases u16 is not sufficiently large to represent a
compressed page's size so use size_t.

Signed-off-by: Minchan Kim <[email protected]>
Reported-by: Weijie Yang <[email protected]>
Acked-by: Sergey Senozhatsky <[email protected]>
Cc: Jerome Marchand <[email protected]>
Cc: Nitin Gupta <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Minchan Kim 2014-08-06 16:08:29 -07:00 • committed by Linus Torvalds
commit 023b409f9d

View file

@ -337,7 +337,7 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index)
unsigned char *cmem;
struct zram_meta *meta = zram->meta;
unsigned long handle;
u16 size;
size_t size;
read_lock(&meta->tb_lock);
handle = meta->table[index].handle;