nfs make use of str_false_true helper
authorHongbo Li <lihongbo22@huawei.com>
Tue, 27 Aug 2024 02:45:17 +0000 (10:45 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 2 Sep 2024 03:43:42 +0000 (20:43 -0700)
The helper str_false_true() was introduced to return "false/true" string
literal.  We can simplify this format by str_false_true.

Link: https://lkml.kernel.org/r/20240827024517.914100-4-lihongbo22@huawei.com
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Cc: Andy Shevchenko <andy@kernel.org>
Cc: Anna Schumaker <anna@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kees Cook <kees@kernel.org>
Cc: Trond Myklebust <trondmy@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/nfs/nfs4xdr.c

index 7704a45096763f9d0f06ad5e873a393f4ddc8c3c..61190d6a5a777ac5970d2f2a0a258ac0dbad1b69 100644 (file)
@@ -3447,7 +3447,7 @@ static int decode_attr_link_support(struct xdr_stream *xdr, uint32_t *bitmap, ui
                *res = be32_to_cpup(p);
                bitmap[0] &= ~FATTR4_WORD0_LINK_SUPPORT;
        }
-       dprintk("%s: link support=%s\n", __func__, *res == 0 ? "false" : "true");
+       dprintk("%s: link support=%s\n", __func__, str_false_true(*res == 0));
        return 0;
 }
 
@@ -3465,7 +3465,7 @@ static int decode_attr_symlink_support(struct xdr_stream *xdr, uint32_t *bitmap,
                *res = be32_to_cpup(p);
                bitmap[0] &= ~FATTR4_WORD0_SYMLINK_SUPPORT;
        }
-       dprintk("%s: symlink support=%s\n", __func__, *res == 0 ? "false" : "true");
+       dprintk("%s: symlink support=%s\n", __func__, str_false_true(*res == 0));
        return 0;
 }
 
@@ -3607,7 +3607,7 @@ static int decode_attr_case_insensitive(struct xdr_stream *xdr, uint32_t *bitmap
                *res = be32_to_cpup(p);
                bitmap[0] &= ~FATTR4_WORD0_CASE_INSENSITIVE;
        }
-       dprintk("%s: case_insensitive=%s\n", __func__, *res == 0 ? "false" : "true");
+       dprintk("%s: case_insensitive=%s\n", __func__, str_false_true(*res == 0));
        return 0;
 }
 
@@ -3625,7 +3625,7 @@ static int decode_attr_case_preserving(struct xdr_stream *xdr, uint32_t *bitmap,
                *res = be32_to_cpup(p);
                bitmap[0] &= ~FATTR4_WORD0_CASE_PRESERVING;
        }
-       dprintk("%s: case_preserving=%s\n", __func__, *res == 0 ? "false" : "true");
+       dprintk("%s: case_preserving=%s\n", __func__, str_false_true(*res == 0));
        return 0;
 }
 
@@ -4333,8 +4333,7 @@ static int decode_attr_xattrsupport(struct xdr_stream *xdr, uint32_t *bitmap,
                *res = be32_to_cpup(p);
                bitmap[2] &= ~FATTR4_WORD2_XATTR_SUPPORT;
        }
-       dprintk("%s: XATTR support=%s\n", __func__,
-               *res == 0 ? "false" : "true");
+       dprintk("%s: XATTR support=%s\n", __func__, str_false_true(*res == 0));
        return 0;
 }