Skip to contentSkip to conversation

staging: lustre: Fix checkpatch.pl warnings.

PATCH Superseded Alberto Pires de Oliveira Neto 2 participants 9 messages Mar 8, 2015 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover staging: lustre: Fix checkpatch.pl warnings.

Alberto Pires de Oliveira Neto (3):
staging: lustre: space prohibited between function name and open parenthesis '('
staging: lustre: void function return statements are not generally useful.
staging: lustre: space required after that close brace '}'

 drivers/staging/lustre/lustre/fld/fld_internal.h | 2 +-
 drivers/staging/lustre/lustre/fld/fld_request.c  | 1 -
 drivers/staging/lustre/lustre/fld/lproc_fld.c    | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 staging: lustre: void function return statements are not generally useful.

This patch fixes checkpatch.pl warning.
WARNING: void function return statements are not generally useful

---
 drivers/staging/lustre/lustre/fld/fld_request.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/lustre/lustre/fld/fld_request.c +0 -1
index 22e0d94..6ac225e 100644
@@ -326,7 +326,6 @@ static int fld_client_proc_init(struct lu_client_fld *fld)
 
 void fld_client_proc_fini(struct lu_client_fld *fld)
 {
-	return;
 }
 #endif
 EXPORT_SYMBOL(fld_client_proc_fini);
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/3 staging: lustre: space prohibited between function name and open parenthesis '('

In reply to Alberto Pires de Oliveira Neto

This patch fixes checkpatch.pl warning.
WARNING: space prohibited between function name and open parenthesis '('

---
 drivers/staging/lustre/lustre/fld/fld_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/fld/fld_internal.h +1 -1
index 6125bbe..68bec765 100644
@@ -142,7 +142,7 @@ extern struct lu_fld_hash fld_hash[];
 int fld_client_rpc(struct obd_export *exp,
 		   struct lu_seq_range *range, __u32 fld_op);
 
-#if defined (CONFIG_PROC_FS)
+#if defined(CONFIG_PROC_FS)
 extern struct lprocfs_vars fld_client_proc_list[];
 #endif
 
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/3 staging: lustre: space required after that close brace '}'

In reply to Alberto Pires de Oliveira Neto

This patch fixes checkpatch.pl warning.
WARNING: space required after that close brace '}'

---
 drivers/staging/lustre/lustre/fld/lproc_fld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/fld/lproc_fld.c +1 -1
index 8c5a657..3235194 100644
@@ -168,4 +168,4 @@ struct lprocfs_vars fld_client_proc_list[] = {
 	{ "targets", &fld_proc_targets_fops },
 	{ "hash", &fld_proc_hash_fops },
 	{ "cache_flush", &fld_proc_cache_flush_fops },
-	{ NULL }};
+	{ NULL } };
Signature · 1 line
1.9.1
#4 lore raw

Re: [PATCH 3/3] staging: lustre: space required after that close brace '}'

Quoted 13 lines · Alberto Pires de Oliveira Neto

This patch fixes checkpatch.pl warning.
WARNING: space required after that close brace '}'

---
 drivers/staging/lustre/lustre/fld/lproc_fld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/fld/lproc_fld.c +0 -0
index 8c5a657..3235194 100644

drivers/staging/lustre/lustre/fld/lproc_fld.c struct lprocfs_vars fld_client_proc_list[] = { · line 171

Quoted 5 lines
drivers/staging/lustre/lustre/fld/lproc_fld.c +1 -1
@@ -168,4 +168,4 @@ struct lprocfs_vars fld_client_proc_list[] = {
 	{ "targets", &fld_proc_targets_fops },
 	{ "hash", &fld_proc_hash_fops },
 	{ "cache_flush", &fld_proc_cache_flush_fops },
-	{ NULL }};
+	{ NULL } };

The generally preferred form would be:

struct lprocfs_vars fld_client_proc_list[] = {
	{ "targets", &fld_proc_targets_fops },
	{ "hash", &fld_proc_hash_fops },
	{ "cache_flush", &fld_proc_cache_flush_fops },
	{ NULL }
};

though that "{ NULL }" is just more commonly "{},"

And it's probably better to remove this from the .h file and this file and move it to the one place it's actually used and make it static (const too eventually)

$ git grep -w fld_client_proc_list
drivers/staging/lustre/lustre/fld/fld_internal.h:extern struct lprocfs_vars fld_client_proc_list[];
drivers/staging/lustre/lustre/fld/fld_request.c:                              fld_client_proc_list, fld);
drivers/staging/lustre/lustre/fld/lproc_fld.c:struct lprocfs_vars fld_client_proc_list[] = {
#5 lore raw

Re: [PATCH 3/3] staging: lustre: space required after that close brace '}'

It make sense. But I would also have move some dependencies as well. As I'm still very new to the kernel, and on my first patches, I believe it's safer to stick to the clean up.
So I'll leave the moving of the structure up to the maintainers if it's ok.

Quoted 41 lines · Joe Perches
Quoted 13 lines · Alberto Pires de Oliveira Neto

This patch fixes checkpatch.pl warning.
WARNING: space required after that close brace '}'

---
 drivers/staging/lustre/lustre/fld/lproc_fld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/fld/lproc_fld.c +0 -0
index 8c5a657..3235194 100644

drivers/staging/lustre/lustre/fld/lproc_fld.c struct lprocfs_vars fld_client_proc_list[] = { · line 171

Quoted 5 lines
drivers/staging/lustre/lustre/fld/lproc_fld.c +1 -1
@@ -168,4 +168,4 @@ struct lprocfs_vars fld_client_proc_list[] = {
      { "targets", &fld_proc_targets_fops },
      { "hash", &fld_proc_hash_fops },
      { "cache_flush", &fld_proc_cache_flush_fops },
-     { NULL }};
+     { NULL } };

The generally preferred form would be:

struct lprocfs_vars fld_client_proc_list[] = {
        { "targets", &fld_proc_targets_fops },
        { "hash", &fld_proc_hash_fops },
        { "cache_flush", &fld_proc_cache_flush_fops },
        { NULL }
};

though that "{ NULL }" is just more commonly "{},"

And it's probably better to remove this from the .h file and this file and move it to the one place it's actually used and make it static (const too eventually)

$ git grep -w fld_client_proc_list
drivers/staging/lustre/lustre/fld/fld_internal.h:extern struct lprocfs_vars fld_client_proc_list[];
drivers/staging/lustre/lustre/fld/fld_request.c:                              fld_client_proc_list, fld);
drivers/staging/lustre/lustre/fld/lproc_fld.c:struct lprocfs_vars fld_client_proc_list[] = {
#6 lore raw

Re: [PATCH 3/3] staging: lustre: space required after that close brace '}'

Quoted 4 lines · Alberto Pires de Oliveira Neto

It make sense. But I would also have move some dependencies as well. As I'm still very new to the kernel, and on my first patches, I believe it's safer to stick to the clean up.
So I'll leave the moving of the structure up to the maintainers if it's ok.

Don't be afraid of making sensible changes.

#7 lore raw

Re: [PATCH 3/3] staging: lustre: space required after that close brace '}'

ok, I'll give it a try.

Quoted 9 lines · Joe Perches
Quoted 4 lines · Alberto Pires de Oliveira Neto

It make sense. But I would also have move some dependencies as well. As I'm still very new to the kernel, and on my first patches, I believe it's safer to stick to the clean up.
So I'll leave the moving of the structure up to the maintainers if it's ok.

Don't be afraid of making sensible changes.

#8 lore raw

Re: [PATCH 3/3] staging: lustre: space required after that close brace '}'

In reply to Joe Perches

it seems that I would have to move all file operations specific to proc_fs from lproc_fld to fld_request.
Although the proc_fs seems to be used only from fld_request, it still seems cleaner to keep them separated than put it all together.

Quoted 41 lines · Joe Perches
Quoted 13 lines · Alberto Pires de Oliveira Neto

This patch fixes checkpatch.pl warning.
WARNING: space required after that close brace '}'

---
 drivers/staging/lustre/lustre/fld/lproc_fld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/fld/lproc_fld.c +0 -0
index 8c5a657..3235194 100644

drivers/staging/lustre/lustre/fld/lproc_fld.c struct lprocfs_vars fld_client_proc_list[] = { · line 171

Quoted 5 lines
drivers/staging/lustre/lustre/fld/lproc_fld.c +1 -1
@@ -168,4 +168,4 @@ struct lprocfs_vars fld_client_proc_list[] = {
      { "targets", &fld_proc_targets_fops },
      { "hash", &fld_proc_hash_fops },
      { "cache_flush", &fld_proc_cache_flush_fops },
-     { NULL }};
+     { NULL } };

The generally preferred form would be:

struct lprocfs_vars fld_client_proc_list[] = {
        { "targets", &fld_proc_targets_fops },
        { "hash", &fld_proc_hash_fops },
        { "cache_flush", &fld_proc_cache_flush_fops },
        { NULL }
};

though that "{ NULL }" is just more commonly "{},"

And it's probably better to remove this from the .h file and this file and move it to the one place it's actually used and make it static (const too eventually)

$ git grep -w fld_client_proc_list
drivers/staging/lustre/lustre/fld/fld_internal.h:extern struct lprocfs_vars fld_client_proc_list[];
drivers/staging/lustre/lustre/fld/fld_request.c:                              fld_client_proc_list, fld);
drivers/staging/lustre/lustre/fld/lproc_fld.c:struct lprocfs_vars fld_client_proc_list[] = {