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/llite_mmap.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/llite_mmap.c')
-rw-r--r-- | drivers/staging/lustre/lustre/llite/llite_mmap.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c index 45f8516e9939..ae605a6d9dc2 100644 --- a/drivers/staging/lustre/lustre/llite/llite_mmap.c +++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c @@ -181,12 +181,14 @@ static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage, LASSERT(vmpage != NULL); io = ll_fault_io_init(vma, &env, &nest, vmpage->index, NULL); - if (IS_ERR(io)) - GOTO(out, result = PTR_ERR(io)); + if (IS_ERR(io)) { + result = PTR_ERR(io); + goto out; + } result = io->ci_result; if (result < 0) - GOTO(out_io, result); + goto out_io; io->u.ci_fault.ft_mkwrite = 1; io->u.ci_fault.ft_writable = 1; |