staging: lustre: llite: Remove else after goto
PATCH 1/3 staging: lustre: llite: Remove else after goto
If an "if" branch is terminated by a "goto", there's no need to have an "else" statement and an indented block of code.
Remove the "else" statement to simplify the code flow.
Signed-off-by Luis de Bethencourt <[email protected]>
---
Hi,
The following patches remove unneeded 'else' after a 'goto' or 'return'. They are meant to just make the code more readable and aren't functional changes.
Thanks,
Luis
drivers/staging/lustre/lustre/llite/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/llite/dir.c +2 -2
@@ -1339,9 +1339,9 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) cmd == LL_IOC_MDC_GETINFO)) { rc =0 ; goto skip_lmm; - } else { - goto out_req; } + + goto out_req; } if (cmd == IOC_MDC_GETFILESTRIPE ||
Signature · 1 line
2.15.1
PATCH 2/3 staging: lustre: llite: Remove redundant else keyword
There is no need to use 'else' if in main branch 'goto' is present.
Signed-off-by Luis de Bethencourt <[email protected]>
--- drivers/staging/lustre/lustre/llite/llite_lib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/lustre/lustre/llite/llite_lib.c +3 -1
@@ -236,7 +236,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,"An MDT (md %s) is performing recovery, of which this client is not a part. Please wait for recovery to complete, abort, or time out.\n" , md); goto out; - }else if (err) { + } + +if (err) {CERROR ("cannot connect to %s: rc = %d\n" , md, err); goto out; }
Signature · 1 line
2.15.1
PATCH 3/3 staging: lustre: llite: Remove redundant else keyword
In reply to Luis de BethencourtThere is no need to use 'else' if in main branch 'return' is present.
Signed-off-by Luis de Bethencourt <[email protected]>
--- drivers/staging/lustre/lustre/llite/vvp_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/llite/vvp_io.c +1 -1
@@ -699,7 +699,7 @@ static int vvp_io_read_start(const struct lu_env *env, result =vvp_prep_size (env, obj, io, pos, tot, &exceed);if (result !=0 )return result; -else if (exceed !=0 ) +if (exceed !=0 ) goto out; LU_OBJECT_HEADER(D_INODE, env, &obj->co_lu,
Signature · 1 line
2.15.1