[PATCHv1] staging: lustre: fixed sparse warnings related to static declarations

2014-11-30 Thread Janet Liu
drivers/staging/lustre/lustre/mdc/mdc_request.c:63:5: warning: symbol 
'mdc_unpack_capa' was not declared. Should it be static?
drivers/staging/lustre/lustre/mdc/mdc_request.c:150:5: warning: symbol 
'mdc_getstatus' was not declared. Should it be static?
drivers/staging/lustre/lustre/mdc/mdc_request.c:217:5: warning: symbol 
'mdc_getattr' was not declared. Should it be static?
drivers/staging/lustre/lustre/mdc/mdc_request.c:261:5: warning: symbol 
'mdc_getattr_name' was not declared. Should it be static?
drivers/staging/lustre/lustre/mdc/mdc_request.c:444:5: warning: symbol 
'mdc_setxattr' was not declared. Should it be static?
drivers/staging/lustre/lustre/mdc/mdc_request.c:455:5: warning: symbol 
'mdc_getxattr' was not declared. Should it be static?

Signed-off-by: Janet Liu jianhua@gmail.com
---
 drivers/staging/lustre/lustre/mdc/mdc_request.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c 
b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 14e1ba1..3b0f245 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -60,7 +60,7 @@ struct mdc_renew_capa_args {
 
 static int mdc_cleanup(struct obd_device *obd);
 
-int mdc_unpack_capa(struct obd_export *exp, struct ptlrpc_request *req,
+static int mdc_unpack_capa(struct obd_export *exp, struct ptlrpc_request *req,
const struct req_msg_field *field, struct obd_capa **oc)
 {
struct lustre_capa *capa;
@@ -147,7 +147,7 @@ out:
 }
 
 /* This should be mdc_get_info(rootfid) */
-int mdc_getstatus(struct obd_export *exp, struct lu_fid *rootfid,
+static int mdc_getstatus(struct obd_export *exp, struct lu_fid *rootfid,
  struct obd_capa **pc)
 {
return send_getstatus(class_exp2cliimp(exp), rootfid, pc,
@@ -214,7 +214,7 @@ static int mdc_getattr_common(struct obd_export *exp,
return 0;
 }
 
-int mdc_getattr(struct obd_export *exp, struct md_op_data *op_data,
+static int mdc_getattr(struct obd_export *exp, struct md_op_data *op_data,
struct ptlrpc_request **request)
 {
struct ptlrpc_request *req;
@@ -258,7 +258,7 @@ int mdc_getattr(struct obd_export *exp, struct md_op_data 
*op_data,
return rc;
 }
 
-int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,
+static int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,
 struct ptlrpc_request **request)
 {
struct ptlrpc_request *req;
@@ -441,7 +441,7 @@ static int mdc_xattr_common(struct obd_export *exp,
return rc;
 }
 
-int mdc_setxattr(struct obd_export *exp, const struct lu_fid *fid,
+static int mdc_setxattr(struct obd_export *exp, const struct lu_fid *fid,
 struct obd_capa *oc, u64 valid, const char *xattr_name,
 const char *input, int input_size, int output_size,
 int flags, __u32 suppgid, struct ptlrpc_request **request)
@@ -452,7 +452,7 @@ int mdc_setxattr(struct obd_export *exp, const struct 
lu_fid *fid,
suppgid, request);
 }
 
-int mdc_getxattr(struct obd_export *exp, const struct lu_fid *fid,
+static int mdc_getxattr(struct obd_export *exp, const struct lu_fid *fid,
 struct obd_capa *oc, u64 valid, const char *xattr_name,
 const char *input, int input_size, int output_size,
 int flags, struct ptlrpc_request **request)
-- 
1.7.9.5

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


[PATCHv1 1/4] staging:lustre:lnet: lib-md.c make line not over 80 characters

2014-08-30 Thread Janet Liu
Silences the following checkpatch warning:
  WARNING: line over 80 characters

Signed-off-by: Janet Liu jianhua@gmail.com
---
 drivers/staging/lustre/lnet/lnet/lib-md.c |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c 
b/drivers/staging/lustre/lnet/lnet/lib-md.c
index 1f386e0..efd1b82 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -52,7 +52,8 @@ lnet_md_unlink(lnet_libmd_t *md)
 
md-md_flags |= LNET_MD_FLAG_ZOMBIE;
 
-   /* Disassociate from ME (if any), and unlink it if it was 
created
+   /* Disassociate from ME (if any),
+* and unlink it if it was created
 * with LNET_UNLINK */
if (me != NULL) {
/* detach MD from portal */
@@ -113,7 +114,8 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
for (i = 0; i  (int)niov; i++) {
/* We take the base address on trust */
-   if (lmd-md_iov.iov[i].iov_len = 0) /* invalid length 
*/
+   /* invalid length */
+   if (lmd-md_iov.iov[i].iov_len = 0)
return -EINVAL;
 
total_length += lmd-md_iov.iov[i].iov_len;
@@ -121,7 +123,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
lmd-md_length = total_length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
 umd-max_size  total_length)) // illegal max_size
return -EINVAL;
@@ -142,7 +144,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
lmd-md_length = total_length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
 umd-max_size  total_length)) // illegal max_size
return -EINVAL;
@@ -152,7 +154,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
lmd-md_iov.iov[0].iov_base = umd-start;
lmd-md_iov.iov[0].iov_len = umd-length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
 umd-max_size  (int)umd-length)) // illegal max_size
return -EINVAL;
@@ -206,7 +208,8 @@ lnet_md_deconstruct(lnet_libmd_t *lmd, lnet_md_t *umd)
 * and that's all.
 */
umd-start = lmd-md_start;
-   umd-length = ((lmd-md_options  (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) 
?
+   umd-length = ((lmd-md_options 
+   (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) ?
  lmd-md_length : lmd-md_niov;
umd-threshold = lmd-md_threshold;
umd-max_size = lmd-md_max_size;
-- 
1.7.9.5

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


[PATCHv1 2/4] staging:lustre:lnet: lib-md.c delete space before '(' for code style

2014-08-30 Thread Janet Liu
Silences the following checkpatch warning:
  WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Janet Liu jianhua@gmail.com
---
 drivers/staging/lustre/lnet/lnet/lib-md.c |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c 
b/drivers/staging/lustre/lnet/lnet/lib-md.c
index efd1b82..13f4332 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -110,7 +110,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
lmd-md_niov = niov = umd-length;
memcpy(lmd-md_iov.iov, umd-start,
-  niov * sizeof (lmd-md_iov.iov[0]));
+  niov * sizeof(lmd-md_iov.iov[0]));
 
for (i = 0; i  (int)niov; i++) {
/* We take the base address on trust */
@@ -131,7 +131,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
} else if ((umd-options  LNET_MD_KIOV) != 0) {
lmd-md_niov = niov = umd-length;
memcpy(lmd-md_iov.kiov, umd-start,
-  niov * sizeof (lmd-md_iov.kiov[0]));
+  niov * sizeof(lmd-md_iov.kiov[0]));
 
for (i = 0; i  (int)niov; i++) {
/* We take the page pointer on trust */
@@ -266,15 +266,15 @@ int
 LNetMDAttach(lnet_handle_me_t meh, lnet_md_t umd,
 lnet_unlink_t unlink, lnet_handle_md_t *handle)
 {
-   LIST_HEAD   (matches);
-   LIST_HEAD   (drops);
+   LIST_HEAD(matches);
+   LIST_HEAD(drops);
struct lnet_me  *me;
struct lnet_libmd   *md;
int cpt;
int rc;
 
-   LASSERT (the_lnet.ln_init);
-   LASSERT (the_lnet.ln_refcount  0);
+   LASSERT(the_lnet.ln_init);
+   LASSERT(the_lnet.ln_refcount  0);
 
if (lnet_md_validate(umd) != 0)
return -EINVAL;
@@ -350,8 +350,8 @@ LNetMDBind(lnet_md_t umd, lnet_unlink_t unlink, 
lnet_handle_md_t *handle)
int cpt;
int rc;
 
-   LASSERT (the_lnet.ln_init);
-   LASSERT (the_lnet.ln_refcount  0);
+   LASSERT(the_lnet.ln_init);
+   LASSERT(the_lnet.ln_refcount  0);
 
if (lnet_md_validate(umd) != 0)
return -EINVAL;
@@ -419,7 +419,7 @@ EXPORT_SYMBOL(LNetMDBind);
  * \retval -ENOENT If \a mdh does not point to a valid MD object.
  */
 int
-LNetMDUnlink (lnet_handle_md_t mdh)
+LNetMDUnlink(lnet_handle_md_t mdh)
 {
lnet_event_tev;
lnet_libmd_t*md;
-- 
1.7.9.5

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


[PATCHv1 3/4] staging:lustre:lnet: lib-md.c erase C99 // comments

2014-08-30 Thread Janet Liu
After changing the comments format, the other error disappears.
So silences two checkpatch errors:
  ERROR: do not use C99 // comments
  ERROR: trailing statements should be on next line

Signed-off-by: Janet Liu jianhua@gmail.com
---
 drivers/staging/lustre/lnet/lnet/lib-md.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c 
b/drivers/staging/lustre/lnet/lnet/lib-md.c
index 13f4332..c858b59 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -125,7 +125,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
-umd-max_size  total_length)) // illegal max_size
+umd-max_size  total_length)) /* illegal max_size */
return -EINVAL;
 
} else if ((umd-options  LNET_MD_KIOV) != 0) {
@@ -146,7 +146,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
-umd-max_size  total_length)) // illegal max_size
+umd-max_size  total_length)) /* illegal max_size */
return -EINVAL;
} else {   /* contiguous */
lmd-md_length = umd-length;
@@ -156,7 +156,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
-umd-max_size  (int)umd-length)) // illegal max_size
+umd-max_size  (int)umd-length)) /* illegal max_size */
return -EINVAL;
}
 
-- 
1.7.9.5

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


[PATCHv1 4/4] staging:lustre:lnet lib-md.c erase space before ')' for code style

2014-08-30 Thread Janet Liu
Silences the following error:
  ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Janet Liu jianhua@gmail.com
---
 drivers/staging/lustre/lnet/lnet/lib-md.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c 
b/drivers/staging/lustre/lnet/lnet/lib-md.c
index c858b59..782b01c 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -136,7 +136,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
for (i = 0; i  (int)niov; i++) {
/* We take the page pointer on trust */
if (lmd-md_iov.kiov[i].kiov_offset +
-   lmd-md_iov.kiov[i].kiov_len  PAGE_CACHE_SIZE )
+   lmd-md_iov.kiov[i].kiov_len  PAGE_CACHE_SIZE)
return -EINVAL; /* invalid length */
 
total_length += lmd-md_iov.kiov[i].kiov_len;
-- 
1.7.9.5

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


[PATCHv2 3/4] staging:lustre:lnet: lib-md.c erase C99 // comments

2014-08-30 Thread Janet Liu
After changing the comments format, the other error disappears.
So silences two checkpatch errors:
  ERROR: do not use C99 // comments
  ERROR: trailing statements should be on next line

Signed-off-by: Janet Liu jianhua@gmail.com
---
 drivers/staging/lustre/lnet/lnet/lib-md.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c 
b/drivers/staging/lustre/lnet/lnet/lib-md.c
index ca08703..5b9c93a 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -125,7 +125,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
(umd-max_size  0 ||
-umd-max_size  total_length)) // illegal max_size
+umd-max_size  total_length)) /* illegal max_size */
return -EINVAL;
 
} else if ((umd-options  LNET_MD_KIOV) != 0) {
@@ -146,7 +146,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
(umd-max_size  0 ||
-umd-max_size  total_length)) // illegal max_size
+umd-max_size  total_length)) /* illegal max_size */
return -EINVAL;
} else {   /* contiguous */
lmd-md_length = umd-length;
@@ -156,7 +156,7 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
(umd-max_size  0 ||
-umd-max_size  (int)umd-length)) // illegal max_size
+umd-max_size  (int)umd-length)) /* illegal max_size */
return -EINVAL;
}
 
-- 
1.7.9.5

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


Re: Fwd: Re: [PATCH] staging:lustre:lnet: lib-md.c fix checkpath warnings and errors.

2014-08-27 Thread Janet Liu

On 08/28/2014 10:20 AM, Janet Liu wrote:




 Original Message 
Subject: Re: [PATCH] staging:lustre:lnet: lib-md.c fix checkpath
warnings and errors.
Date: Tue, 26 Aug 2014 18:22:45 -0700
From: Greg KH gre...@linuxfoundation.org
To: Janet Liu janetliu...@qq.com
CC: de...@driverdev.osuosl.org, linux-ker...@vger.kernel.org

On Mon, Aug 25, 2014 at 01:18:54AM +0800, Janet Liu wrote:

Sliences the following warning and error:

  WARNING: line over 80 characters
  WARNING: space prohibited between function name and open parenthesis
'('
  ERROR: do not use C99 // comments
  ERROR: trailing statements should be on next line


You changed 4 things, in one patch :(

Also, you sent 4 different patches, which one is correct?

Please only do one thing per patch and please resend with the one that
you wish to have reviewed.

thanks,

greg k-h



Hi Greg,

I'm very sorry for having troubled you.

The latest one is correct. It is send by my gmail box.

The first two is sent by this mailbox(janetliu...@qq.com) and is 
rejected by linux-ker...@vger.kernel.org.


The third is tested by dan.carpen...@oracle.com, he told me it broke 
build. So I fixed and send the fourth.


Those are all codestyle issue.

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


[PATCH] staging:lustre:lnet: lib-md.c fix checkpath warnings and errors.

2014-08-24 Thread Janet Liu
Sliences the following warning and error:

  WARNING: line over 80 characters
  WARNING: space prohibited between function name and open parenthesis '('
  ERROR: do not use C99 // comments
  ERROR: trailing statements should be on next line

Signed-off-by: Janet Liu janetliu...@qq.com
---
 drivers/staging/lustre/lnet/lnet/lib-md.c |   44 -
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c 
b/drivers/staging/lustre/lnet/lnet/lib-md.c
index 1f386e0..ef3733d 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -52,7 +52,8 @@ lnet_md_unlink(lnet_libmd_t *md)
 
md-md_flags |= LNET_MD_FLAG_ZOMBIE;
 
-   /* Disassociate from ME (if any), and unlink it if it was 
created
+   /* Disassociate from ME (if any),
+* and unlink it if it was created
 * with LNET_UNLINK */
if (me != NULL) {
/* detach MD from portal */
@@ -109,11 +110,12 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int 
unlink)
 
lmd-md_niov = niov = umd-length;
memcpy(lmd-md_iov.iov, umd-start,
-  niov * sizeof (lmd-md_iov.iov[0]));
+  niov * sizeof(lmd-md_iov.iov[0]));
 
for (i = 0; i  (int)niov; i++) {
/* We take the base address on trust */
-   if (lmd-md_iov.iov[i].iov_len = 0) /* invalid length 
*/
+/* invalid length */
+   if (lmd-md_iov.iov[i].iov_len = 0)
return -EINVAL;
 
total_length += lmd-md_iov.iov[i].iov_len;
@@ -121,20 +123,21 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int 
unlink)
 
lmd-md_length = total_length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
-   (umd-max_size  0 ||
-umd-max_size  total_length)) // illegal max_size
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
+
+   (umd-max_size  0 ||
+   umd-max_size  total_length)) /* illegal max_size */
return -EINVAL;
 
} else if ((umd-options  LNET_MD_KIOV) != 0) {
lmd-md_niov = niov = umd-length;
memcpy(lmd-md_iov.kiov, umd-start,
-  niov * sizeof (lmd-md_iov.kiov[0]));
+  niov * sizeof(lmd-md_iov.kiov[0]));
 
for (i = 0; i  (int)niov; i++) {
/* We take the page pointer on trust */
if (lmd-md_iov.kiov[i].kiov_offset +
-   lmd-md_iov.kiov[i].kiov_len  PAGE_CACHE_SIZE )
+   lmd-md_iov.kiov[i].kiov_len  PAGE_CACHE_SIZE)
return -EINVAL; /* invalid length */
 
total_length += lmd-md_iov.kiov[i].kiov_len;
@@ -142,9 +145,9 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
lmd-md_length = total_length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
-umd-max_size  total_length)) // illegal max_size
+umd-max_size  total_length)) /* illegal max_size */
return -EINVAL;
} else {   /* contiguous */
lmd-md_length = umd-length;
@@ -152,9 +155,9 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
lmd-md_iov.iov[0].iov_base = umd-start;
lmd-md_iov.iov[0].iov_len = umd-length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
-umd-max_size  (int)umd-length)) // illegal max_size
+umd-max_size  (int)umd-length)) /* illegal max_size */
return -EINVAL;
}
 
@@ -206,7 +209,8 @@ lnet_md_deconstruct(lnet_libmd_t *lmd, lnet_md_t *umd)
 * and that's all.
 */
umd-start = lmd-md_start;
-   umd-length = ((lmd-md_options  (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) 
?
+   umd-length = ((lmd-md_options 
+   (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) ?
  lmd-md_length : lmd-md_niov;
umd-threshold = lmd-md_threshold;
umd-max_size = lmd-md_max_size;
@@ -263,15 +267,15 @@ int
 LNetMDAttach(lnet_handle_me_t meh, lnet_md_t umd,
 lnet_unlink_t unlink, lnet_handle_md_t *handle)
 {
-   LIST_HEAD   (matches);
-   LIST_HEAD   (drops);
+   LIST_HEAD   matches

[PATCH] staging:lustre:lnet: lib-md.c fix checkpath warnings and errors.

2014-08-24 Thread Janet Liu
Sliences the following warning and error:

  WARNING: line over 80 characters
  WARNING: space prohibited between function name and open parenthesis '('
  ERROR: do not use C99 // comments
  ERROR: trailing statements should be on next line

Signed-off-by: Janet Liu janetliu...@qq.com
---
 drivers/staging/lustre/lnet/lnet/lib-md.c |   44 -
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c 
b/drivers/staging/lustre/lnet/lnet/lib-md.c
index 1f386e0..ef3733d 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -52,7 +52,8 @@ lnet_md_unlink(lnet_libmd_t *md)
 
md-md_flags |= LNET_MD_FLAG_ZOMBIE;
 
-   /* Disassociate from ME (if any), and unlink it if it was 
created
+   /* Disassociate from ME (if any),
+* and unlink it if it was created
 * with LNET_UNLINK */
if (me != NULL) {
/* detach MD from portal */
@@ -109,11 +110,12 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int 
unlink)
 
lmd-md_niov = niov = umd-length;
memcpy(lmd-md_iov.iov, umd-start,
-  niov * sizeof (lmd-md_iov.iov[0]));
+  niov * sizeof(lmd-md_iov.iov[0]));
 
for (i = 0; i  (int)niov; i++) {
/* We take the base address on trust */
-   if (lmd-md_iov.iov[i].iov_len = 0) /* invalid length 
*/
+/* invalid length */
+   if (lmd-md_iov.iov[i].iov_len = 0)
return -EINVAL;
 
total_length += lmd-md_iov.iov[i].iov_len;
@@ -121,20 +123,21 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int 
unlink)
 
lmd-md_length = total_length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
-   (umd-max_size  0 ||
-umd-max_size  total_length)) // illegal max_size
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
+
+   (umd-max_size  0 ||
+   umd-max_size  total_length)) /* illegal max_size */
return -EINVAL;
 
} else if ((umd-options  LNET_MD_KIOV) != 0) {
lmd-md_niov = niov = umd-length;
memcpy(lmd-md_iov.kiov, umd-start,
-  niov * sizeof (lmd-md_iov.kiov[0]));
+  niov * sizeof(lmd-md_iov.kiov[0]));
 
for (i = 0; i  (int)niov; i++) {
/* We take the page pointer on trust */
if (lmd-md_iov.kiov[i].kiov_offset +
-   lmd-md_iov.kiov[i].kiov_len  PAGE_CACHE_SIZE )
+   lmd-md_iov.kiov[i].kiov_len  PAGE_CACHE_SIZE)
return -EINVAL; /* invalid length */
 
total_length += lmd-md_iov.kiov[i].kiov_len;
@@ -142,9 +145,9 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
lmd-md_length = total_length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
-umd-max_size  total_length)) // illegal max_size
+umd-max_size  total_length)) /* illegal max_size */
return -EINVAL;
} else {   /* contiguous */
lmd-md_length = umd-length;
@@ -152,9 +155,9 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
lmd-md_iov.iov[0].iov_base = umd-start;
lmd-md_iov.iov[0].iov_len = umd-length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
-umd-max_size  (int)umd-length)) // illegal max_size
+umd-max_size  (int)umd-length)) /* illegal max_size */
return -EINVAL;
}
 
@@ -206,7 +209,8 @@ lnet_md_deconstruct(lnet_libmd_t *lmd, lnet_md_t *umd)
 * and that's all.
 */
umd-start = lmd-md_start;
-   umd-length = ((lmd-md_options  (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) 
?
+   umd-length = ((lmd-md_options 
+   (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) ?
  lmd-md_length : lmd-md_niov;
umd-threshold = lmd-md_threshold;
umd-max_size = lmd-md_max_size;
@@ -263,15 +267,15 @@ int
 LNetMDAttach(lnet_handle_me_t meh, lnet_md_t umd,
 lnet_unlink_t unlink, lnet_handle_md_t *handle)
 {
-   LIST_HEAD   (matches);
-   LIST_HEAD   (drops);
+   LIST_HEAD   matches

[PATCH] staging:lustre: lib-md.c fix checkpath warnings and errors.

2014-08-24 Thread Janet Liu
Sliences the following warning and error:

  WARNING: line over 80 characters
  WARNING: space prohibited between function name and open parenthesis '('
  ERROR: do not use C99 // comments
  ERROR: trailing statements should be on next line

Signed-off-by: Janet Liu jianhua@gmail.com
---
 drivers/staging/lustre/lnet/lnet/lib-md.c |   44 -
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c 
b/drivers/staging/lustre/lnet/lnet/lib-md.c
index 1f386e0..ef3733d 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -52,7 +52,8 @@ lnet_md_unlink(lnet_libmd_t *md)
 
md-md_flags |= LNET_MD_FLAG_ZOMBIE;
 
-   /* Disassociate from ME (if any), and unlink it if it was 
created
+   /* Disassociate from ME (if any),
+* and unlink it if it was created
 * with LNET_UNLINK */
if (me != NULL) {
/* detach MD from portal */
@@ -109,11 +110,12 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int 
unlink)
 
lmd-md_niov = niov = umd-length;
memcpy(lmd-md_iov.iov, umd-start,
-  niov * sizeof (lmd-md_iov.iov[0]));
+  niov * sizeof(lmd-md_iov.iov[0]));
 
for (i = 0; i  (int)niov; i++) {
/* We take the base address on trust */
-   if (lmd-md_iov.iov[i].iov_len = 0) /* invalid length 
*/
+/* invalid length */
+   if (lmd-md_iov.iov[i].iov_len = 0)
return -EINVAL;
 
total_length += lmd-md_iov.iov[i].iov_len;
@@ -121,20 +123,21 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int 
unlink)
 
lmd-md_length = total_length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
-   (umd-max_size  0 ||
-umd-max_size  total_length)) // illegal max_size
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
+
+   (umd-max_size  0 ||
+   umd-max_size  total_length)) /* illegal max_size */
return -EINVAL;
 
} else if ((umd-options  LNET_MD_KIOV) != 0) {
lmd-md_niov = niov = umd-length;
memcpy(lmd-md_iov.kiov, umd-start,
-  niov * sizeof (lmd-md_iov.kiov[0]));
+  niov * sizeof(lmd-md_iov.kiov[0]));
 
for (i = 0; i  (int)niov; i++) {
/* We take the page pointer on trust */
if (lmd-md_iov.kiov[i].kiov_offset +
-   lmd-md_iov.kiov[i].kiov_len  PAGE_CACHE_SIZE )
+   lmd-md_iov.kiov[i].kiov_len  PAGE_CACHE_SIZE)
return -EINVAL; /* invalid length */
 
total_length += lmd-md_iov.kiov[i].kiov_len;
@@ -142,9 +145,9 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
 
lmd-md_length = total_length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
-umd-max_size  total_length)) // illegal max_size
+umd-max_size  total_length)) /* illegal max_size */
return -EINVAL;
} else {   /* contiguous */
lmd-md_length = umd-length;
@@ -152,9 +155,9 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
lmd-md_iov.iov[0].iov_base = umd-start;
lmd-md_iov.iov[0].iov_len = umd-length;
 
-   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /* max size used 
*/
+   if ((umd-options  LNET_MD_MAX_SIZE) != 0  /*max size used*/
(umd-max_size  0 ||
-umd-max_size  (int)umd-length)) // illegal max_size
+umd-max_size  (int)umd-length)) /* illegal max_size */
return -EINVAL;
}
 
@@ -206,7 +209,8 @@ lnet_md_deconstruct(lnet_libmd_t *lmd, lnet_md_t *umd)
 * and that's all.
 */
umd-start = lmd-md_start;
-   umd-length = ((lmd-md_options  (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) 
?
+   umd-length = ((lmd-md_options 
+   (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) ?
  lmd-md_length : lmd-md_niov;
umd-threshold = lmd-md_threshold;
umd-max_size = lmd-md_max_size;
@@ -263,15 +267,15 @@ int
 LNetMDAttach(lnet_handle_me_t meh, lnet_md_t umd,
 lnet_unlink_t unlink, lnet_handle_md_t *handle)
 {
-   LIST_HEAD   (matches);
-   LIST_HEAD   (drops);
+   LIST_HEAD   matches