Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1169444 > unrolled thread

[PATCH 5/5] staging: lustre: osc: drop trivially useless initialization

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2015-06-20 21:20 +0200
Last post2015-06-21 02:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 5/5] staging: lustre: osc: drop trivially useless initialization Julia Lawall <Julia.Lawall@lip6.fr> - 2015-06-20 21:20 +0200
    Re: [PATCH 5/5] staging: lustre: osc: drop trivially useless  initialization Julia Lawall <julia.lawall@lip6.fr> - 2015-06-21 02:50 +0200

#1169444 — [PATCH 5/5] staging: lustre: osc: drop trivially useless initialization

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2015-06-20 21:20 +0200
Subject[PATCH 5/5] staging: lustre: osc: drop trivially useless initialization
Message-ID<pDwt4-7lc-9@gated-at.bofh.it>
Remove initialization of a variable that is immediately reassigned.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/staging/lustre/lustre/osc/osc_page.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/staging/lustre/lustre/osc/osc_page.c b/drivers/staging/lustre/lustre/osc/osc_page.c
--- a/drivers/staging/lustre/lustre/osc/osc_page.c
+++ b/drivers/staging/lustre/lustre/osc/osc_page.c
@@ -471,7 +471,7 @@ static int osc_page_flush(const struct l
 			  struct cl_io *io)
 {
 	struct osc_page *opg = cl2osc_page(slice);
-	int rc = 0;
+	int rc;
 
 	rc = osc_flush_async_page(env, io, opg);
 	return rc;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1169499 — Re: [PATCH 5/5] staging: lustre: osc: drop trivially useless initialization

FromJulia Lawall <julia.lawall@lip6.fr>
Date2015-06-21 02:50 +0200
SubjectRe: [PATCH 5/5] staging: lustre: osc: drop trivially useless initialization
Message-ID<pDBCp-6cA-5@gated-at.bofh.it>
In reply to#1169444
On Sat, 20 Jun 2015, Joachim Eastwood wrote:

> On 20 June 2015 at 21:07, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> > Remove initialization of a variable that is immediately reassigned.
> >
> > The semantic patch that makes this change is as follows:
> > (http://coccinelle.lip6.fr/)
> >
> > // <smpl>
> > @@
> > type T;
> > identifier x;
> > constant C;
> > expression e;
> > @@
> >
> > T x
> > - = C
> >  ;
> > x = e;
> > // </smpl>
> >
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > ---
> >  drivers/staging/lustre/lustre/osc/osc_page.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff -u -p a/drivers/staging/lustre/lustre/osc/osc_page.c b/drivers/staging/lustre/lustre/osc/osc_page.c
> > --- a/drivers/staging/lustre/lustre/osc/osc_page.c
> > +++ b/drivers/staging/lustre/lustre/osc/osc_page.c
> > @@ -471,7 +471,7 @@ static int osc_page_flush(const struct l
> >                           struct cl_io *io)
> >  {
> >         struct osc_page *opg = cl2osc_page(slice);
> > -       int rc = 0;
> > +       int rc;
> >
> >         rc = osc_flush_async_page(env, io, opg);
> >         return rc;
> >
> 
> The whole rc variable is kinda useless.
> 
> Why not make it just:
> return osc_flush_async_page(env, io, opg);

Sure.  I'll fix that.

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web