linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ubifs: Use XATTR_*_PREFIX_LEN
@ 2016-01-02 22:12 Richard Weinberger
  2016-01-03 13:52 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Weinberger @ 2016-01-02 22:12 UTC (permalink / raw)
  To: dedekind1; +Cc: adrian.hunter, linux-mtd, linux-kernel, Richard Weinberger

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ubifs: Use XATTR_*_PREFIX_LEN
  2016-01-02 22:12 [PATCH] ubifs: Use XATTR_*_PREFIX_LEN Richard Weinberger
@ 2016-01-03 13:52 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2016-01-03 13:52 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: adrian.hunter, linux-mtd, linux-kernel

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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-03 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-02 22:12 [PATCH] ubifs: Use XATTR_*_PREFIX_LEN Richard Weinberger
2016-01-03 13:52 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).