staging: erofs: use xattr_prefix to wrap up
authorGao Xiang <gaoxiang25@huawei.com>
Tue, 29 Jan 2019 08:35:19 +0000 (16:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jan 2019 14:38:50 +0000 (15:38 +0100)
Let's use xattr_prefix instead of open code.
No logic changes.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/xattr.c

index 1c9498e..7de4669 100644 (file)
@@ -520,8 +520,7 @@ static int xattr_entrylist(struct xattr_iter *_it,
        if (h == NULL || (h->list != NULL && !h->list(it->dentry)))
                return 1;
 
-       /* Note that at least one of 'prefix' and 'name' should be non-NULL */
-       prefix = h->prefix != NULL ? h->prefix : h->name;
+       prefix = xattr_prefix(h);
        prefix_len = strlen(prefix);
 
        if (it->buffer == NULL) {