ubifs: Use XATTR_*_PREFIX_LEN
authorRichard Weinberger <richard@nod.at>
Sat, 2 Jan 2016 22:12:42 +0000 (23:12 +0100)
committerRichard Weinberger <richard@nod.at>
Sun, 10 Jan 2016 11:33:47 +0000 (12:33 +0100)
...instead of open coding it.

Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/xattr.c

index e8b01b721e99d3954e344686fc615c9455e4246c..e53292d0c21bcd9d57c3f219d3f7cc31d5eb836e 100644 (file)
@@ -267,7 +267,7 @@ static int check_namespace(const struct qstr *nm)
 
        if (!strncmp(nm->name, XATTR_TRUSTED_PREFIX,
                     XATTR_TRUSTED_PREFIX_LEN)) {
-               if (nm->name[sizeof(XATTR_TRUSTED_PREFIX) - 1] == '\0')
+               if (nm->name[XATTR_TRUSTED_PREFIX_LEN] == '\0')
                        return -EINVAL;
                type = TRUSTED_XATTR;
        } else if (!strncmp(nm->name, XATTR_USER_PREFIX,
@@ -277,7 +277,7 @@ static int check_namespace(const struct qstr *nm)
                type = USER_XATTR;
        } else if (!strncmp(nm->name, XATTR_SECURITY_PREFIX,
                                     XATTR_SECURITY_PREFIX_LEN)) {
-               if (nm->name[sizeof(XATTR_SECURITY_PREFIX) - 1] == '\0')
+               if (nm->name[XATTR_SECURITY_PREFIX_LEN] == '\0')
                        return -EINVAL;
                type = SECURITY_XATTR;
        } else