diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2014-08-30 16:24:55 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-30 12:23:30 -0700 |
commit | 34e1f2bb1e7ab87c2b950189f7ccae57a72f25a8 (patch) | |
tree | 408ce70b98aa8808fd7d5c0632968f653d0df4f8 /drivers/staging/lustre/lustre/llite/symlink.c | |
parent | staging:lustre:lnet lib-md.c erase space before ')' for code style (diff) | |
download | linux-dev-34e1f2bb1e7ab87c2b950189f7ccae57a72f25a8.tar.xz linux-dev-34e1f2bb1e7ab87c2b950189f7ccae57a72f25a8.zip |
staging: lustre: llite: expand the GOTO macro
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
identifier lbl;
@@
if (...)
GOTO(lbl,...);
+else
GOTO(lbl,...);
@@
identifier lbl,rc;
constant c;
expression e,e1;
@@
if (
- e
+ !e
)
- GOTO(lbl,\(rc\|c\));
-else GOTO(lbl,e1);
+ e1;
+goto lbl;
@@
identifier lbl,rc;
constant c;
expression e,e1;
@@
if (e)
- GOTO(lbl,e1);
-else GOTO(lbl,\(rc\|c\));
+ e1;
+goto lbl;
@@
identifier lbl;
expression e,e1,e2;
@@
if (e)
- GOTO(lbl,e1);
-else GOTO(lbl,e2);
+ e1;
+else e2;
+goto lbl;
// ------------------------------------------------------------------------
@@
identifier lbl,rc;
constant c;
@@
- GOTO(lbl,\(rc\|c\));
+ goto lbl;
@@
identifier lbl;
expression rc;
@@
- GOTO(lbl,rc);
+ rc;
+ goto lbl;
// </smpl>
The rules above the line deal with the case where the goto desination is
the same whether or not the the branch is taken. In that case, the goto is
created in just one instance after the if. This affects only the files
namei.c and llite_lib.c.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/llite/symlink.c')
-rw-r--r-- | drivers/staging/lustre/lustre/llite/symlink.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/staging/lustre/lustre/llite/symlink.c b/drivers/staging/lustre/lustre/llite/symlink.c index 20e678b31c7b..29fb16d4f144 100644 --- a/drivers/staging/lustre/lustre/llite/symlink.c +++ b/drivers/staging/lustre/lustre/llite/symlink.c @@ -77,21 +77,23 @@ static int ll_readlink_internal(struct inode *inode, if (rc) { if (rc != -ENOENT) CERROR("inode %lu: rc = %d\n", inode->i_ino, rc); - GOTO (failed, rc); + goto failed; } body = req_capsule_server_get(&(*request)->rq_pill, &RMF_MDT_BODY); LASSERT(body != NULL); if ((body->valid & OBD_MD_LINKNAME) == 0) { CERROR("OBD_MD_LINKNAME not set on reply\n"); - GOTO(failed, rc = -EPROTO); + rc = -EPROTO; + goto failed; } LASSERT(symlen != 0); if (body->eadatasize != symlen) { CERROR("inode %lu: symlink length %d not expected %d\n", inode->i_ino, body->eadatasize - 1, symlen - 1); - GOTO(failed, rc = -EPROTO); + rc = -EPROTO; + goto failed; } *symname = req_capsule_server_get(&(*request)->rq_pill, &RMF_MDT_MD); @@ -100,7 +102,8 @@ static int ll_readlink_internal(struct inode *inode, /* not full/NULL terminated */ CERROR("inode %lu: symlink not NULL terminated string" "of length %d\n", inode->i_ino, symlen - 1); - GOTO(failed, rc = -EPROTO); + rc = -EPROTO; + goto failed; } OBD_ALLOC(lli->lli_symlink_name, symlen); |