2015-08-04 08:14:07

by Jandy Gou

[permalink] [raw]
Subject: [PATCH] Fix coding style error

Fix the following two coding style errors:

ERROR: space prohibited before that '++' (ctx:WxO)
#890: FILE: drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h:890:
+ index ++;

ERROR: space prohibited before open square bracket '['
#724: FILE: drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h:724:
+ return (&kiblnd_data.kib_peers [hash]);

Jandy Gou (1):
staging: lustre: Fix coding style errors

drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--
1.9.1


2015-08-04 08:13:57

by Jandy Gou

[permalink] [raw]
Subject: [PATCH] staging: lustre: Fix coding style errors

Signed-off-by: Jandy Gou <[email protected]>
---
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
index 0d8fa3a..185da2c 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
@@ -721,7 +721,7 @@ kiblnd_nid2peerlist (lnet_nid_t nid)
unsigned int hash =
((unsigned int)nid) % kiblnd_data.kib_peer_hash_size;

- return (&kiblnd_data.kib_peers [hash]);
+ return (&kiblnd_data.kib_peers[hash]);
}

static inline int
@@ -887,7 +887,7 @@ kiblnd_rd_consume_frag(kib_rdma_desc_t *rd, int index, __u32 nob)
rd->rd_frags[index].rf_addr += nob;
rd->rd_frags[index].rf_nob -= nob;
} else {
- index ++;
+ index++;
}

return index;
--
1.9.1

2015-08-05 03:32:56

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] staging: lustre: Fix coding style errors

On Tue, 2015-08-04 at 16:10 +0800, Jandy Gou wrote:
> Signed-off-by: Jandy Gou <[email protected]>
[]
> diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
[]
> @@ -721,7 +721,7 @@ kiblnd_nid2peerlist (lnet_nid_t nid)
> unsigned int hash =
> ((unsigned int)nid) % kiblnd_data.kib_peer_hash_size;
>
> - return (&kiblnd_data.kib_peers [hash]);
> + return (&kiblnd_data.kib_peers[hash]);

Please run your own patches though checkpatch and
please remove the unnecessary parenthesis around
the return value at the same time.