Andi Drebes wrote:
This patch removes a variable from fs/cramfs/inode.c that is just used to store
a return value which is immediately read afterwards.
Tested on an i386 box.
Signed-off-by: Andi Drebes <lists-receive@xxxxxxxxxxxxxxxxxxx>
---
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index 350680f..42d2cf8 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -372,7 +372,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
char *name;
ino_t ino;
mode_t mode;
- int namelen, error;
+ int namelen;
mutex_lock(&read_mutex);
de = cramfs_read(sb, OFFSET(inode) + offset, sizeof(*de)+CRAMFS_MAXPATHLEN);
@@ -398,8 +398,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
break;
namelen--;
}
- error = filldir(dirent, buf, namelen, offset, ino, mode >> 12);
- if (error)
+ if(filldir(dirent, buf, namelen, offset, ino, mode >> 12))
Maybe picky but please leave it as "if (".
Also, is it suppose to mean that if filldir() can do/execute
(something), "break;" is going to happened? The 'error'-variable has the
added value of telling the programmer it is an error-condition. So IMHO
a "!= 0" would be appropriate (or in the range the error-values are in).
Richard Knutsson
-
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html