mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2 06/11] nfs: drop an unneeded variable from nfs_do_open()
Date: Fri,  7 Feb 2014 22:28:08 +0100	[thread overview]
Message-ID: <1391808493-27328-6-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <1391808493-27328-1-git-send-email-u.kleine-koenig@pengutronix.de>

While at it also fix the type of flen holding a string length
(int -> size_t).

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 fs/nfs.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/fs/nfs.c b/fs/nfs.c
index 761bfd626716..79df6a8e4f7a 100644
--- a/fs/nfs.c
+++ b/fs/nfs.c
@@ -616,7 +616,7 @@ static struct file_priv *nfs_do_open(struct device_d *dev, const char *filename)
 	struct file_priv *priv;
 	struct nfs_priv *npriv = dev->priv;
 	int ret;
-	const char *fname, *tok;
+	const char *tok;
 
 	priv = xzalloc(sizeof(*priv));
 
@@ -629,25 +629,23 @@ static struct file_priv *nfs_do_open(struct device_d *dev, const char *filename)
 
 	filename++;
 
-	fname = filename;
-
 	memcpy(priv->filefh, npriv->rootfh, NFS_FHSIZE);
 
-	while (*fname) {
-		int flen;
+	while (*filename) {
+		size_t flen;
 
-		tok = strchr(fname, '/');
+		tok = strchr(filename, '/');
 		if (tok)
-			flen = tok - fname;
+			flen = tok - filename;
 		else
-			flen = strlen(fname);
+			flen = strlen(filename);
 
-		ret = nfs_lookup_req(priv, fname, flen);
+		ret = nfs_lookup_req(priv, filename, flen);
 		if (ret)
 			goto out;
 
 		if (tok)
-			fname += flen + 1;
+			filename += flen + 1;
 		else
 			break;
 	}
-- 
1.8.5.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2014-02-07 21:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 21:28 [PATCH v2 01/11] net: net_read_uint32: assert that only 32 bit are read Uwe Kleine-König
2014-02-07 21:28 ` [PATCH v2 02/11] nfs: fix mount prog version in portmap lookup Uwe Kleine-König
2014-02-07 21:28 ` [PATCH v2 03/11] nfs: skip over stale rpc packets Uwe Kleine-König
2014-02-07 21:28 ` [PATCH v2 04/11] nfs: shorten and simplify rpc_add_credentials a bit Uwe Kleine-König
2014-02-08  6:51   ` Jean-Christophe PLAGNIOL-VILLARD
2014-02-08 15:11     ` Uwe Kleine-König
2014-02-07 21:28 ` [PATCH v2 05/11] nfs: simplify rpc_lookup_req Uwe Kleine-König
2014-02-07 21:28 ` Uwe Kleine-König [this message]
2014-02-07 21:28 ` [PATCH v2 07/11] net: new function net_read_uint64 Uwe Kleine-König
2014-02-07 21:28 ` [PATCH v2 08/11] net: provide alternatives to {ntoh, hton}[sl] funtions with cleaner semantics Uwe Kleine-König
2014-02-07 21:28 ` [PATCH v2 09/11] nfs: switch to nfs3 Uwe Kleine-König
2014-02-07 21:28 ` [PATCH v2 10/11] mount: support filesystem options passed via -o Uwe Kleine-König
2014-02-07 21:28 ` [PATCH v2 11/11] nfs: parse nfsport and mount port from file system options Uwe Kleine-König
2014-02-10  8:02 ` [PATCH v2 01/11] net: net_read_uint32: assert that only 32 bit are read Sascha Hauer

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=1391808493-27328-6-git-send-email-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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