Skip to contentSkip to conversation

apparmor: Use str_yes_no() helper function

PATCH RESEND In review Thorsten Blum 2 participants 4 messages Dec 20, 2024 – Jan 24, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 apparmor: Use str_yes_no() helper function

Remove hard-coded strings by using the str_yes_no() helper function.

Fix a typo in a comment: s/unpritable/unprintable/

---
 security/apparmor/apparmorfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
security/apparmor/apparmorfs.c +4 -4
index 2c0185ebc900..1bce9a7d2129 100644
@@ -997,7 +997,7 @@ static int aa_sfs_seq_show(struct seq_file *seq, void *v)
 
 	switch (fs_file->v_type) {
 	case AA_SFS_TYPE_BOOLEAN:
-		seq_printf(seq, "%s\n", fs_file->v.boolean ? "yes" : "no");
+		seq_printf(seq, "%s\n", str_yes_no(fs_file->v.boolean));
 		break;
 	case AA_SFS_TYPE_STRING:
 		seq_printf(seq, "%s\n", fs_file->v.string);
@@ -1006,7 +1006,7 @@ static int aa_sfs_seq_show(struct seq_file *seq, void *v)
 		seq_printf(seq, "%#08lx\n", fs_file->v.u64);
 		break;
 	default:
-		/* Ignore unpritable entry types. */
+		/* Ignore unprintable entry types. */
 		break;
 	}
 
@@ -1152,7 +1152,7 @@ static int seq_ns_stacked_show(struct seq_file *seq, void *v)
 	struct aa_label *label;
 
 	label = begin_current_label_crit_section();
-	seq_printf(seq, "%s\n", label->size > 1 ? "yes" : "no");
+	seq_printf(seq, "%s\n", str_yes_no(label->size > 1));
 	end_current_label_crit_section(label);
 
 	return 0;
@@ -1175,7 +1175,7 @@ static int seq_ns_nsstacked_show(struct seq_file *seq, void *v)
 			}
 	}
 
-	seq_printf(seq, "%s\n", count > 1 ? "yes" : "no");
+	seq_printf(seq, "%s\n", str_yes_no(count > 1));
 	end_current_label_crit_section(label);
 
 	return 0;
Signature · 1 line
2.47.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Thorsten Blum

Remove hard-coded strings by using the str_yes_no() helper function.

Fix a typo in a comment: s/unpritable/unprintable/

Hey Thorsten,

sorry for the delay on this I am just really backlogged and will try to catch-up on the mailing list traffic this weekend.

I have pulled this into my tree and it should migrate into linux-next soon

Quoted 44 lines
---
  security/apparmor/apparmorfs.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
security/apparmor/apparmorfs.c +4 -4
index 2c0185ebc900..1bce9a7d2129 100644
@@ -997,7 +997,7 @@ static int aa_sfs_seq_show(struct seq_file *seq, void *v)
 
  	switch (fs_file->v_type) {
  	case AA_SFS_TYPE_BOOLEAN:
-		seq_printf(seq, "%s\n", fs_file->v.boolean ? "yes" : "no");
+		seq_printf(seq, "%s\n", str_yes_no(fs_file->v.boolean));
  		break;
  	case AA_SFS_TYPE_STRING:
  		seq_printf(seq, "%s\n", fs_file->v.string);
@@ -1006,7 +1006,7 @@ static int aa_sfs_seq_show(struct seq_file *seq, void *v)
  		seq_printf(seq, "%#08lx\n", fs_file->v.u64);
  		break;
  	default:
-		/* Ignore unpritable entry types. */
+		/* Ignore unprintable entry types. */
  		break;
  	}
 
@@ -1152,7 +1152,7 @@ static int seq_ns_stacked_show(struct seq_file *seq, void *v)
  	struct aa_label *label;
 
  	label = begin_current_label_crit_section();
-	seq_printf(seq, "%s\n", label->size > 1 ? "yes" : "no");
+	seq_printf(seq, "%s\n", str_yes_no(label->size > 1));
  	end_current_label_crit_section(label);
 
  	return 0;
@@ -1175,7 +1175,7 @@ static int seq_ns_nsstacked_show(struct seq_file *seq, void *v)
  			}
  	}
 
-	seq_printf(seq, "%s\n", count > 1 ? "yes" : "no");
+	seq_printf(seq, "%s\n", str_yes_no(count > 1));
  	end_current_label_crit_section(label);
 
  	return 0;
#2 lore raw
Quoted 5 lines · John Johansen
Quoted 3 lines · Thorsten Blum

Remove hard-coded strings by using the str_yes_no() helper function. Fix a typo in a comment: s/unpritable/unprintable/

Quoted 8 lines

Hey Thorsten,

sorry for the delay on this I am just really backlogged and will try to catch-up on the mailing list traffic this weekend.

I have pulled this into my tree and it should migrate into linux-next soon

Hi John, I can't find this in linux-next yet. Any ideas?

Thanks,
Thorsten

maintainer
#3 lore raw
Quoted 8 lines · Thorsten Blum
Quoted 7 lines · John Johansen
Quoted 3 lines · Thorsten Blum

Remove hard-coded strings by using the str_yes_no() helper function. Fix a typo in a comment: s/unpritable/unprintable/

Hey Thorsten,

Quoted 9 lines
Quoted 6 lines

sorry for the delay on this I am just really backlogged and will try to catch-up on the mailing list traffic this weekend.

I have pulled this into my tree and it should migrate into linux-next soon

Hi John, I can't find this in linux-next yet. Any ideas?

yeah sorry, I had to disable my pre push hook, it does some sanity checks around sign-offs, checkpatch, etc and well takes a while. Any ways it was tripping on some stuff causing it not to push, and the last few week being crazy I just missed it.