Skip to content

Commit 3c90e90

Browse files
tobluxrichardweinberger
authored andcommitted
jffs2: Use str_yes_no() helper function
Remove hard-coded strings by using the str_yes_no() helper function. Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 67efb77 commit 3c90e90

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fs/jffs2/nodemgmt.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/mtd/mtd.h>
1616
#include <linux/compiler.h>
1717
#include <linux/sched/signal.h>
18+
#include <linux/string_choices.h>
1819
#include "nodelist.h"
1920
#include "debug.h"
2021

@@ -317,9 +318,9 @@ static int jffs2_find_nextblock(struct jffs2_sb_info *c)
317318
And there's no space left. At all. */
318319
pr_crit("Argh. No free space left for GC. nr_erasing_blocks is %d. nr_free_blocks is %d. (erasableempty: %s, erasingempty: %s, erasependingempty: %s)\n",
319320
c->nr_erasing_blocks, c->nr_free_blocks,
320-
list_empty(&c->erasable_list) ? "yes" : "no",
321-
list_empty(&c->erasing_list) ? "yes" : "no",
322-
list_empty(&c->erase_pending_list) ? "yes" : "no");
321+
str_yes_no(list_empty(&c->erasable_list)),
322+
str_yes_no(list_empty(&c->erasing_list)),
323+
str_yes_no(list_empty(&c->erase_pending_list)));
323324
return -ENOSPC;
324325
}
325326

@@ -883,7 +884,7 @@ int jffs2_thread_should_wake(struct jffs2_sb_info *c)
883884

884885
jffs2_dbg(1, "%s(): nr_free_blocks %d, nr_erasing_blocks %d, dirty_size 0x%x, vdirty_blocks %d: %s\n",
885886
__func__, c->nr_free_blocks, c->nr_erasing_blocks,
886-
c->dirty_size, nr_very_dirty, ret ? "yes" : "no");
887+
c->dirty_size, nr_very_dirty, str_yes_no(ret));
887888

888889
return ret;
889890
}

0 commit comments

Comments
 (0)