Skip to contentSkip to conversation

staging: lustre: fld_request.c: Remove else after return.

PATCH Superseded Alberto Pires de Oliveira Neto 2 participants 3 messages Feb 28, 2015 – Mar 2, 2015 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: lustre: fld_request.c: Remove else after return.

This patch fixes checkpatch.pl warning.
WARNING: else is not generally useful after a break or return

---
 drivers/staging/lustre/lustre/fld/fld_request.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/staging/lustre/lustre/fld/fld_request.c +3 -4
index b8d17e1..0b00301 100644
@@ -217,10 +217,9 @@ int fld_client_add_target(struct lu_client_fld *fld,
 		CERROR("%s: Attempt to add target %s (idx %llu) on fly - skip it\n",
 			fld->lcf_name, name, tar->ft_idx);
 		return 0;
-	} else {
-		CDEBUG(D_INFO, "%s: Adding target %s (idx %llu)\n",
-		       fld->lcf_name, name, tar->ft_idx);
-	}
+	} 
+	CDEBUG(D_INFO, "%s: Adding target %s (idx %llu)\n",
+			fld->lcf_name, name, tar->ft_idx);
 
 	OBD_ALLOC_PTR(target);
 	if (target == NULL)
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 16 lines · Alberto Pires de Oliveira Neto

This patch fixes checkpatch.pl warning.
WARNING: else is not generally useful after a break or return

---
 drivers/staging/lustre/lustre/fld/fld_request.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/staging/lustre/lustre/fld/fld_request.c +0 -0
index b8d17e1..0b00301 100644
@@ -217,10 +217,9 @@ int fld_client_add_target(struct lu_client_fld *fld,
 		CERROR("%s: Attempt to add target %s (idx %llu) on fly - skip it\n",
 			fld->lcf_name, name, tar->ft_idx);
 		return 0;

drivers/staging/lustre/lustre/fld/fld_request.c int fld_client_add_target(struct lu_client_fld *fld, · line 225

Quoted 10 lines
drivers/staging/lustre/lustre/fld/fld_request.c +3 -4
-	} else {
-		CDEBUG(D_INFO, "%s: Adding target %s (idx %llu)\n",
-		       fld->lcf_name, name, tar->ft_idx);
-	}
+	} 
+	CDEBUG(D_INFO, "%s: Adding target %s (idx %llu)\n",
+			fld->lcf_name, name, tar->ft_idx);
 
 	OBD_ALLOC_PTR(target);
 	if (target == NULL)

Never add new checkpatch errors when trying to fix checkpatch errors, as you will never end up removing them...

Please fix and resend.

#2 lore raw

that's true.

I think it's ok now.

Quoted 32 lines · Greg KH
Quoted 16 lines · Alberto Pires de Oliveira Neto

This patch fixes checkpatch.pl warning.
WARNING: else is not generally useful after a break or return

---
 drivers/staging/lustre/lustre/fld/fld_request.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/staging/lustre/lustre/fld/fld_request.c +0 -0
index b8d17e1..0b00301 100644
@@ -217,10 +217,9 @@ int fld_client_add_target(struct lu_client_fld *fld,
              CERROR("%s: Attempt to add target %s (idx %llu) on fly - skip it\n",
                      fld->lcf_name, name, tar->ft_idx);
              return 0;

drivers/staging/lustre/lustre/fld/fld_request.c int fld_client_add_target(struct lu_client_fld *fld, · line 225

Quoted 10 lines
drivers/staging/lustre/lustre/fld/fld_request.c +3 -4
-     } else {
-             CDEBUG(D_INFO, "%s: Adding target %s (idx %llu)\n",
-                    fld->lcf_name, name, tar->ft_idx);
-     }
+     }
+     CDEBUG(D_INFO, "%s: Adding target %s (idx %llu)\n",
+                     fld->lcf_name, name, tar->ft_idx);
 
      OBD_ALLOC_PTR(target);
      if (target == NULL)

Never add new checkpatch errors when trying to fix checkpatch errors, as you will never end up removing them...

Please fix and resend.