zram: use scnprintf() in attrs show() methods
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Mon, 7 Apr 2014 22:38:22 +0000 (15:38 -0700)
committerAlex Shi <alex.shi@linaro.org>
Mon, 11 May 2015 12:43:33 +0000 (20:43 +0800)
commit575ef7bc322df6e0384ef661f510928bfa1dab81
tree9ff9bdd7a5419cfde6b4be1844effb60176e7bac
parent1b2dc1d89b1a5bff45782c9ddb6e0d384c7c6420
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>
(cherry picked from commit 56b4e8cb85827a2ccc4752a2a7148e56b62b7e96)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
drivers/block/zram/zcomp.c
drivers/block/zram/zram_drv.c