From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752459AbcABWMw (ORCPT ); Sat, 2 Jan 2016 17:12:52 -0500 Received: from mail.sigma-star.at ([95.130.255.111]:45996 "EHLO mail.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752226AbcABWMt (ORCPT ); Sat, 2 Jan 2016 17:12:49 -0500 From: Richard Weinberger To: dedekind1@gmail.com Cc: adrian.hunter@intel.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Richard Weinberger Subject: [PATCH] ubifs: Use XATTR_*_PREFIX_LEN Date: Sat, 2 Jan 2016 23:12:42 +0100 Message-Id: <1451772762-2360-1-git-send-email-richard@nod.at> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ...instead of open coding it. Signed-off-by: Richard Weinberger --- 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