Patchwork [06/30] UBIFS: minor cleanup: use S_ISREG helper

login
register
mail settings
Submitter Artem Bityutskiy
Date June 9, 2011, 9:04 a.m.
Message ID <1307610310-28691-7-git-send-email-dedekind1@gmail.com>
Download mbox | patch
Permalink /patch/99681/
State New
Headers show

Comments

Artem Bityutskiy - June 9, 2011, 9:04 a.m.
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

Instead of using long "(inode->i_mode & S_IFMT) != S_IFREG" expression, use
shorted "!S_ISREG(inode->i_mode)".

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 fs/ubifs/super.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 55161c6..70e8c92 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -85,7 +85,7 @@  static int validate_inode(struct ubifs_info *c, const struct inode *inode)
 	if (ui->data_len < 0 || ui->data_len > UBIFS_MAX_INO_DATA)
 		return 4;
 
-	if (ui->xattr && (inode->i_mode & S_IFMT) != S_IFREG)
+	if (ui->xattr && !S_ISREG(inode->i_mode))
 		return 5;
 
 	if (!ubifs_compr_present(ui->compr_type)) {