From 2d02b0b81c0474212310c5a72cf088736c9aab41 Mon Sep 17 00:00:00 2001 From: Vaishali Thakkar Date: Tue, 23 Sep 2014 19:21:32 +0530 Subject: [PATCH] Staging: lustre: Unnecessory else and braces are removed This patch fixes following checkpatch.pl warning using coccinelle: WARNING: else is not generally useful after a break or return Semantic patch used for this is as follows: @rule1@ expression e1; @@ if (e1) { ... return ...; } - else{ ... - } @rule2@ expression e2; statement s1; @@ if(e2) { ... return ...; } - else s1 Signed-off-by: Vaishali Thakkar Acked-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/obdclass/capa.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/capa.c b/drivers/staging/lustre/lustre/obdclass/capa.c index 6a4b4d70c105..cd1abce378ea 100644 --- a/drivers/staging/lustre/lustre/obdclass/capa.c +++ b/drivers/staging/lustre/lustre/obdclass/capa.c @@ -213,12 +213,11 @@ struct obd_capa *capa_add(struct hlist_head *hash, struct lustre_capa *capa) capa_delete_lru(list); spin_unlock(&capa_lock); return ocapa; - } else { - capa_get(old); - spin_unlock(&capa_lock); - capa_put(ocapa); - return old; } + capa_get(old); + spin_unlock(&capa_lock); + capa_put(ocapa); + return old; } EXPORT_SYMBOL(capa_add); -- 2.39.5