mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesper Juhl <juhl-lkml@dif.dk>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "Jesper Juhl" <juhl-lkml@dif.dk>,
	"Steve French" <sfrench@samba.org>,
	"Steve French" <sfrench@us.ibm.com>,
	samba-technical <samba-technical@lists.samba.org>,
	"Jörn Engel" <joern@wohnheim.fh-wedel.de>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [patch 3/3] get rid of two unnessesary assignments in fs/cifs/file.c
Date: Wed, 29 Dec 2004 00:55:51 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.61.0412290052530.3528@dragon.hygekrogen.localhost> (raw)
In-Reply-To: <1104104286.16545.7.camel@localhost.localdomain>


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@dif.dk>

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;




      parent reply	other threads:[~2004-12-28 23:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-26 23:24 [patch] copy_to_user check and whitespace cleanups " Jesper Juhl
2004-12-26 23:38 ` Alan Cox
2004-12-27  1:21   ` Jesper Juhl
2004-12-28 23:48   ` [patch 1/3] copy_to_user check " Jesper Juhl
2004-12-28 22:45     ` Alan Cox
2004-12-28 23:52   ` [patch 2/3] whitespace cleanups " Jesper Juhl
2004-12-29  1:57     ` Jörn Engel
2004-12-29  2:59       ` Jesper Juhl
2004-12-29 12:29         ` Jörn Engel
2004-12-29 18:48           ` Domen Puncer
2004-12-29 13:42         ` [patch 2/3] " Horst von Brand
2004-12-29 14:48           ` Jörn Engel
2004-12-29 16:31             ` Horst von Brand
2004-12-29  9:51       ` Wichert Akkerman
2004-12-29 12:10         ` Jörn Engel
2005-01-03 12:01         ` Martin Waitz
2004-12-28 23:55   ` Jesper Juhl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0412290052530.3528@dragon.hygekrogen.localhost \
    --to=juhl-lkml@dif.dk \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.org \
    --cc=sfrench@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®