diff mbox

ubifs: Use XATTR_*_PREFIX_LEN

Message ID 1451772762-2360-1-git-send-email-richard@nod.at
State Superseded
Headers show

Commit Message

Richard Weinberger Jan. 2, 2016, 10:12 p.m. UTC
...instead of open coding it.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 fs/ubifs/xattr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Artem Bityutskiy Jan. 3, 2016, 1:52 p.m. UTC | #1
On Sat, 2016-01-02 at 23:12 +0100, Richard Weinberger wrote:
> ...instead of open coding it.
> 
> Signed-off-by: Richard Weinberger <richard@nod.at>

Looks good, thanks!

Signed-off-buy: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
diff mbox

Patch

diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
index e8b01b7..e53292d 100644
--- a/fs/ubifs/xattr.c
+++ b/fs/ubifs/xattr.c
@@ -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