zram: Use __sysfs_match_string() helper
Subsystems (2)
PATCH 1/1 zram: Use __sysfs_match_string() helper
Use __sysfs_match_string() helper instead of open coded variant.
Cc Minchan Kim <[email protected]>
Cc Nitin Gupta <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/block/zram/zcomp.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/block/zram/zcomp.c +4 -6
@@ -68,13 +68,11 @@ static struct zcomp_strm *zcomp_strm_alloc(struct zcomp *comp)bool zcomp_available_algorithm (const char *comp) { -int i =0 ; +int i; -while (backends[i]) { -if (sysfs_streq (comp, backends[i])) -return true; - i++; - } + i =__sysfs_match_string (backends,-1 , comp); +if (i >=0 ) +return true;/* * Crypto does not ignore a trailing new line symbol,
Signature · 1 line
2.11.0
(Cc Andrew)
Link lkml.kernel.org/r/[email protected]
Quoted 6 lines · Andy Shevchenko
Use
__sysfs_match_string()helper instead of open coded variant.Cc Minchan Kim <[email protected]>Cc Nitin Gupta <[email protected]>Cc Sergey Senozhatsky <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>
Reviewed-by Sergey Senozhatsky <[email protected]>
-ss
Quoted 6 lines · Sergey Senozhatsky
(Cc Andrew)
Link lkml.kernel.org/r/[email protected]On (06/09/17 15:08), Andy Shevchenko wrote:
Quoted 8 lines
Quoted 6 lines
Use
__sysfs_match_string()helper instead of open coded variant.Cc Minchan Kim <[email protected]>Cc Nitin Gupta <[email protected]>Cc Sergey Senozhatsky <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>Reviewed-by Sergey Senozhatsky <[email protected]>
Acked-by Minchan Kim <[email protected]>
Thanks.