Re: [patch 3/3] get rid of two unnessesary assignments in fs/cifs/file.c

From: Jesper Juhl
Date: Tue Dec 28 2004 - 18:48:33 EST



in two places in fs/cifs/file.c we assign -EIO to a variable (rc) then
do something unrelated to rc, then return rc. The assignment of -EIO to rc
is unnessesary, we may as well just return -EIO directly and avoid the
extra assignment (yeah, the compiler will probably optimize it, but
still...).


Signed-off-by: Jesper Juhl <juhl-lkml@xxxxxx>

diff -up linux-2.6.10/fs/cifs/file.c~ linux-2.6.10/fs/cifs/file.c
--- linux-2.6.10/fs/cifs/file.c~ 2004-12-29 00:41:00.000000000 +0100
+++ linux-2.6.10/fs/cifs/file.c 2004-12-29 00:40:51.000000000 +0100
@@ -1947,17 +1947,15 @@ cifs_readdir(struct file *file, void *di
xid = GetXid();

if (file->f_dentry == NULL) {
- rc = -EIO;
FreeXid(xid);
- return rc;
+ return -EIO;
}
cifs_sb = CIFS_SB(file->f_dentry->d_sb);
pTcon = cifs_sb->tcon;
bufsize = pTcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE;
if (bufsize > CIFSMaxBufSize) {
- rc = -EIO;
FreeXid(xid);
- return rc;
+ return -EIO;
}
data = kmalloc(bufsize, GFP_KERNEL);
pfindData = (FILE_DIRECTORY_INFO *)data;



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