[PATCH] staging: lustre: make functions as static

2014-02-26 Thread Daeseok Youn

These functions are only referenced in this file scope
so it can be marked static.
And remove space between function name and open parenthesis.

Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c|   94 ++--
 1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index 644a000..0c333cb 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -41,7 +41,7 @@
 #include o2iblnd.h
 #include asm/div64.h
 
-lnd_t the_o2iblnd = {
+static lnd_t the_o2iblnd = {
.lnd_type   = O2IBLND,
.lnd_startup= kiblnd_startup,
.lnd_shutdown   = kiblnd_shutdown,
@@ -53,8 +53,8 @@ lnd_t the_o2iblnd = {
 
 kib_data_t   kiblnd_data;
 
-__u32
-kiblnd_cksum (void *ptr, int nob)
+static __u32
+kiblnd_cksum(void *ptr, int nob)
 {
char  *c  = ptr;
__u32  sum = 0;
@@ -368,7 +368,7 @@ kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp, 
lnet_nid_t nid)
 }
 
 void
-kiblnd_destroy_peer (kib_peer_t *peer)
+kiblnd_destroy_peer(kib_peer_t *peer)
 {
kib_net_t *net = peer-ibp_ni-ni_data;
 
@@ -390,7 +390,7 @@ kiblnd_destroy_peer (kib_peer_t *peer)
 }
 
 kib_peer_t *
-kiblnd_find_peer_locked (lnet_nid_t nid)
+kiblnd_find_peer_locked(lnet_nid_t nid)
 {
/* the caller is responsible for accounting the additional reference
 * that this creates */
@@ -419,7 +419,7 @@ kiblnd_find_peer_locked (lnet_nid_t nid)
 }
 
 void
-kiblnd_unlink_peer_locked (kib_peer_t *peer)
+kiblnd_unlink_peer_locked(kib_peer_t *peer)
 {
LASSERT (list_empty(peer-ibp_conns));
 
@@ -429,8 +429,8 @@ kiblnd_unlink_peer_locked (kib_peer_t *peer)
kiblnd_peer_decref(peer);
 }
 
-int
-kiblnd_get_peer_info (lnet_ni_t *ni, int index,
+static int
+kiblnd_get_peer_info(lnet_ni_t *ni, int index,
  lnet_nid_t *nidp, int *count)
 {
kib_peer_t  *peer;
@@ -468,8 +468,8 @@ kiblnd_get_peer_info (lnet_ni_t *ni, int index,
return -ENOENT;
 }
 
-void
-kiblnd_del_peer_locked (kib_peer_t *peer)
+static void
+kiblnd_del_peer_locked(kib_peer_t *peer)
 {
struct list_head   *ctmp;
struct list_head   *cnxt;
@@ -489,8 +489,8 @@ kiblnd_del_peer_locked (kib_peer_t *peer)
 * last ref on it. */
 }
 
-int
-kiblnd_del_peer (lnet_ni_t *ni, lnet_nid_t nid)
+static int
+kiblnd_del_peer(lnet_ni_t *ni, lnet_nid_t nid)
 {
LIST_HEAD(zombies);
struct list_head*ptmp;
@@ -543,8 +543,8 @@ kiblnd_del_peer (lnet_ni_t *ni, lnet_nid_t nid)
return rc;
 }
 
-kib_conn_t *
-kiblnd_get_conn_by_idx (lnet_ni_t *ni, int index)
+static kib_conn_t *
+kiblnd_get_conn_by_idx(lnet_ni_t *ni, int index)
 {
kib_peer_t  *peer;
struct list_head*ptmp;
@@ -584,16 +584,16 @@ kiblnd_get_conn_by_idx (lnet_ni_t *ni, int index)
return NULL;
 }
 
-void
-kiblnd_debug_rx (kib_rx_t *rx)
+static void
+kiblnd_debug_rx(kib_rx_t *rx)
 {
CDEBUG(D_CONSOLE,   %p status %d msg_type %x cred %d\n,
   rx, rx-rx_status, rx-rx_msg-ibm_type,
   rx-rx_msg-ibm_credits);
 }
 
-void
-kiblnd_debug_tx (kib_tx_t *tx)
+static void
+kiblnd_debug_tx(kib_tx_t *tx)
 {
CDEBUG(D_CONSOLE,   %p snd %d q %d w %d rc %d dl %lx 
   cookie LPX64 msg %s%s type %x cred %d\n,
@@ -604,8 +604,8 @@ kiblnd_debug_tx (kib_tx_t *tx)
   tx-tx_msg-ibm_type, tx-tx_msg-ibm_credits);
 }
 
-void
-kiblnd_debug_conn (kib_conn_t *conn)
+static void
+kiblnd_debug_conn(kib_conn_t *conn)
 {
struct list_head*tmp;
int i;
@@ -920,7 +920,7 @@ kiblnd_create_conn(kib_peer_t *peer, struct rdma_cm_id 
*cmid,
 }
 
 void
-kiblnd_destroy_conn (kib_conn_t *conn)
+kiblnd_destroy_conn(kib_conn_t *conn)
 {
struct rdma_cm_id *cmid = conn-ibc_cmid;
kib_peer_t  *peer = conn-ibc_peer;
@@ -988,7 +988,7 @@ kiblnd_destroy_conn (kib_conn_t *conn)
 }
 
 int
-kiblnd_close_peer_conns_locked (kib_peer_t *peer, int why)
+kiblnd_close_peer_conns_locked(kib_peer_t *peer, int why)
 {
kib_conn_t   *conn;
struct list_head *ctmp;
@@ -1011,7 +1011,7 @@ kiblnd_close_peer_conns_locked (kib_peer_t *peer, int why)
 }
 
 int
-kiblnd_close_stale_conns_locked (kib_peer_t *peer,
+kiblnd_close_stale_conns_locked(kib_peer_t *peer,
 int version, __u64 incarnation)
 {
kib_conn_t   *conn;
@@ -1039,8 +1039,8 @@ kiblnd_close_stale_conns_locked (kib_peer_t *peer,
return count;
 }
 
-int
-kiblnd_close_matching_conns (lnet_ni_t *ni, lnet_nid_t nid)
+static int
+kiblnd_close_matching_conns(lnet_ni_t *ni, lnet_nid_t nid)
 {
kib_peer_t   *peer;
struct list_head *ptmp;
@@ -1142,7 +1142,7 @@ 

Re: [PATCH] staging: lustre: make functions as static

2014-02-26 Thread Dan Carpenter
On Wed, Feb 26, 2014 at 06:17:59PM +0900, Daeseok Youn wrote:
 
 These functions are only referenced in this file scope
 so it can be marked static.
 And remove space between function name and open parenthesis.

If it's on the same line as a static change then it's fine, otherwise
it should go in a separate patch.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: make functions as static

2014-02-26 Thread DaeSeok Youn
Actually , I saw some code like this file which is seperate line
between return value and function name.
So I didn't make one line of them.

Ok, I will make another patch after merge this one.
Thanks.
Daeseok Youn.

2014-02-26 18:20 GMT+09:00, Dan Carpenter dan.carpen...@oracle.com:
 On Wed, Feb 26, 2014 at 06:17:59PM +0900, Daeseok Youn wrote:

 These functions are only referenced in this file scope
 so it can be marked static.
 And remove space between function name and open parenthesis.

 If it's on the same line as a static change then it's fine, otherwise
 it should go in a separate patch.

 regards,
 dan carpenter


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: make functions as static

2014-02-26 Thread DaeSeok Youn
Oh.. sorry.
Ok, I will seperate this patch as you said.

Thanks.
Daeseok Youn.

2014-02-26 20:31 GMT+09:00, Dan Carpenter dan.carpen...@oracle.com:
 On Wed, Feb 26, 2014 at 08:11:40PM +0900, DaeSeok Youn wrote:
 Actually , I saw some code like this file which is seperate line
 between return value and function name.
 So I didn't make one line of them.

 Ok, I will make another patch after merge this one.

 No, you are misunderstanding what I am saying.  Those type of function
 declarations are allowed in the kernel so the original code is fine.
 What I am saying is this patch is doing two thing but it should be doing
 only one thing.

  @@ -53,8 +53,8 @@ lnd_t the_o2iblnd = {

  kib_data_tkiblnd_data;

 -__u32
 -kiblnd_cksum (void *ptr, int nob)
 +static __u32
 +kiblnd_cksum(void *ptr, int nob)
  {
  char  *c  = ptr;
  __u32  sum = 0;

 Changing the white space here is OK because it is a minor related
 white space change.

 @@ -368,7 +368,7 @@ kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp,
 lnet_nid_t nid)
  }

  void
 -kiblnd_destroy_peer (kib_peer_t *peer)
 +kiblnd_destroy_peer(kib_peer_t *peer)
 {

 This is a random unrelated white space change, so do it in a separate
 patch.

 regards,
 dan carpenter


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel