zram: cut trailing newline in algorithm name
authorSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Thu, 25 Jun 2015 22:00:29 +0000 (15:00 -0700)
committerDanny Wood <danwood76@gmail.com>
Tue, 14 Sep 2021 19:02:17 +0000 (20:02 +0100)
commit5b25b5dac9c3a3c9cd1e90cd66887f779b1d0d37
tree00c8171d07a2033319b585af6947c6751fd97cbb
parent2a60ea2cfd489d746a09cace7e67f1c36bb3476a
zram: cut trailing newline in algorithm name

Supplied sysfs values sometimes contain new-line symbols (echo vs.  echo
-n), which we also copy as a compression algorithm name.  it works fine
when we lookup for compression algorithm, because we use sysfs_streq()
which takes care of new line symbols.  however, it doesn't look nice when
we print compression algorithm name if zcomp_create() failed:

 zram: Cannot initialise LXZ
            compressing backend

cut trailing new-line, so the error string will look like

  zram: Cannot initialise LXZ compressing backend

we also now can replace sysfs_streq() in zcomp_available_show() with
strcmp().

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