public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs: nfsd: export: fix coding style issues
@ 2010-02-08 21:36 chihau Chau
  2010-02-09  5:36 ` Arjan van de Ven
  0 siblings, 1 reply; 2+ messages in thread
From: chihau Chau @ 2010-02-08 21:36 UTC (permalink / raw)
  To: bfields
  Cc: neilb, viro, Trond.Myklebust, bharrosh, akpm, linux-nfs,
	linux-kernel, Chihau Chau

From: Chihau Chau <chihau@gmail.com>

This fixes some coding style issues like spaces required, lines over 80
characters, assignments in if conditions and trailing whitespaces.

Signed-off-by: Chihau Chau <chihau@gmail.com>
---
 fs/nfsd/export.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index c487810..4ecb07b 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -41,7 +41,7 @@ static int		exp_verify_string(char *cp, int max);
 
 #define	EXPKEY_HASHBITS		8
 #define	EXPKEY_HASHMAX		(1 << EXPKEY_HASHBITS)
-#define	EXPKEY_HASHMASK		(EXPKEY_HASHMAX -1)
+#define	EXPKEY_HASHMASK		(EXPKEY_HASHMAX - 1)
 static struct cache_head *expkey_table[EXPKEY_HASHMAX];
 
 static void expkey_put(struct kref *ref)
@@ -66,7 +66,7 @@ static void expkey_request(struct cache_detail *cd,
 	qword_add(bpp, blen, ek->ek_client->name);
 	snprintf(type, 5, "%d", ek->ek_fsidtype);
 	qword_add(bpp, blen, type);
-	qword_addhex(bpp, blen, (char*)ek->ek_fsid, key_len(ek->ek_fsidtype));
+	qword_addhex(bpp, blen, (char *)ek->ek_fsid, key_len(ek->ek_fsidtype));
 	(*bpp)[-1] = '\n';
 }
 
@@ -75,7 +75,8 @@ static int expkey_upcall(struct cache_detail *cd, struct cache_head *h)
 	return sunrpc_cache_pipe_upcall(cd, h, expkey_request);
 }
 
-static struct svc_expkey *svc_expkey_update(struct svc_expkey *new, struct svc_expkey *old);
+static struct svc_expkey *svc_expkey_update(struct svc_expkey *new,
+							struct svc_expkey *old);
 static struct svc_expkey *svc_expkey_lookup(struct svc_expkey *);
 static struct cache_detail svc_expkey_cache;
 
@@ -101,7 +102,8 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
 		goto out;
 
 	err = -EINVAL;
-	if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
+	len = qword_get(&mesg, buf, PAGE_SIZE);
+	if (len <= 0)
 		goto out;
 
 	err = -ENOENT;
@@ -111,15 +113,17 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
 	dprintk("found domain %s\n", buf);
 
 	err = -EINVAL;
-	if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
+	len = qword_get(&mesg, buf, PAGE_SIZE);
+	if (len <= 0)
 		goto out;
 	fsidtype = simple_strtoul(buf, &ep, 10);
 	if (*ep)
 		goto out;
 	dprintk("found fsidtype %d\n", fsidtype);
-	if (key_len(fsidtype)==0) /* invalid type */
+	if (key_len(fsidtype) == 0) /* invalid type */
 		goto out;
-	if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
+	len = qword_get(&mesg, buf, PAGE_SIZE);
+	if (len <= 0)
 		goto out;
 	dprintk("found fsid length %d\n", len);
 	if (len != key_len(fsidtype))
@@ -131,7 +135,7 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
 	if (key.h.expiry_time == 0)
 		goto out;
 
-	key.ek_client = dom;	
+	key.ek_client = dom;
 	key.ek_fsidtype = fsidtype;
 	memcpy(key.ek_fsid, buf, len);
 
@@ -181,16 +185,16 @@ static int expkey_show(struct seq_file *m,
 	struct svc_expkey *ek ;
 	int i;
 
-	if (h ==NULL) {
+	if (h == NULL) {
 		seq_puts(m, "#domain fsidtype fsid [path]\n");
 		return 0;
 	}
 	ek = container_of(h, struct svc_expkey, h);
 	seq_printf(m, "%s %d 0x", ek->ek_client->name,
 		   ek->ek_fsidtype);
-	for (i=0; i < key_len(ek->ek_fsidtype)/4; i++)
+	for (i = 0; i < key_len(ek->ek_fsidtype)/4; i++)
 		seq_printf(m, "%08x", ek->ek_fsid[i]);
-	if (test_bit(CACHE_VALID, &h->flags) && 
+	if (test_bit(CACHE_VALID, &h->flags) &&
 	    !test_bit(CACHE_NEGATIVE, &h->flags)) {
 		seq_printf(m, " ");
 		seq_path(m, &ek->ek_path, "\\ \t\n");
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs: nfsd: export: fix coding style issues
  2010-02-08 21:36 [PATCH] fs: nfsd: export: fix coding style issues chihau Chau
@ 2010-02-09  5:36 ` Arjan van de Ven
  0 siblings, 0 replies; 2+ messages in thread
From: Arjan van de Ven @ 2010-02-09  5:36 UTC (permalink / raw)
  To: chihau Chau
  Cc: bfields, neilb, viro, Trond.Myklebust, bharrosh, akpm, linux-nfs,
	linux-kernel, Chihau Chau

> -static struct svc_expkey *svc_expkey_update(struct svc_expkey *new, struct svc_expkey *old); 
> +static struct svc_expkey *svc_expkey_update(struct svc_expkey *new,
> +							struct svc_expkey *old); 


how is this an improvement ? I don't find the 2nd more more readable

also, are you planning to do real changes to this file? If not, I would suggest not doing cleanups like this;
while cleanups like the other things you did are fine as a first step to doing real work on a file, it's usually
not liked very much to ONLY do such cosmetic things...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-09  5:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-08 21:36 [PATCH] fs: nfsd: export: fix coding style issues chihau Chau
2010-02-09  5:36 ` Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox