zram: use scnprintf() in attrs show() methods
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Mon, 7 Apr 2014 22:38:22 +0000 (15:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Apr 2014 23:36:02 +0000 (16:36 -0700)
commit56b4e8cb85827a2ccc4752a2a7148e56b62b7e96
tree48a9d05f13fd1c1dedf768879ebb4c05c7cf2fed
parent60a726e33375a1096e85399cfa1327081b4c38be
zram: use scnprintf() in attrs show() methods

sysfs.txt documentation lists the following requirements:

 - The buffer will always be PAGE_SIZE bytes in length. On i386, this
   is 4096.

 - show() methods should return the number of bytes printed into the
   buffer. This is the return value of scnprintf().

 - show() should always use scnprintf().

Use scnprintf() in show() functions.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/zram/zcomp.c
drivers/block/zram/zram_drv.c