]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
apparmor: Use str_yes_no() helper function
authorThorsten Blum <thorsten.blum@linux.dev>
Fri, 20 Dec 2024 19:22:42 +0000 (20:22 +0100)
committerJohn Johansen <john.johansen@canonical.com>
Sat, 18 Jan 2025 14:47:11 +0000 (06:47 -0800)
Remove hard-coded strings by using the str_yes_no() helper function.

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

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/apparmorfs.c

index 2c0185ebc900daa9b40edf58dcef84905c86e52e..1bce9a7d21296914bd5ba0241338233e8d5f0116 100644 (file)
@@ -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;