Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1300138 > unrolled thread

[PATCH] ubifs: Use XATTR_*_PREFIX_LEN

Started byRichard Weinberger <richard@nod.at>
First post2016-01-02 23:20 +0100
Last post2016-01-03 15:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ubifs: Use XATTR_*_PREFIX_LEN Richard Weinberger <richard@nod.at> - 2016-01-02 23:20 +0100
    Re: [PATCH] ubifs: Use XATTR_*_PREFIX_LEN Artem Bityutskiy <dedekind1@gmail.com> - 2016-01-03 15:00 +0100

#1300138 — [PATCH] ubifs: Use XATTR_*_PREFIX_LEN

FromRichard Weinberger <richard@nod.at>
Date2016-01-02 23:20 +0100
Subject[PATCH] ubifs: Use XATTR_*_PREFIX_LEN
Message-ID<qMCGK-5oA-7@gated-at.bofh.it>
...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(-)

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
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1300308

FromArtem Bityutskiy <dedekind1@gmail.com>
Date2016-01-03 15:00 +0100
Message-ID<qMRmq-69u-13@gated-at.bofh.it>
In reply to#1300138
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>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web