All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Madhumthia Prabakaran <madhumithabiw@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] Staging: sm750fb: Remove an unnecessary local variable in a function
Date: Wed, 13 Mar 2019 20:49:53 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1903132049340.2515@hadrien> (raw)
In-Reply-To: <20190313153958.GA5065@madhuleo>



On Wed, 13 Mar 2019, Madhumthia Prabakaran wrote:

> On Wed, Mar 13, 2019 at 04:35:39PM +0100, Julia Lawall wrote:
> >
> >
> > On Wed, 13 Mar 2019, Madhumitha Prabakaran wrote:
> >
> > > Remove an unnecessary local variable in  sm750_format_pll_reg function
> > > and replace its initialization directly in return type.
> > > Issue suggested by Coccinelle using ret.cocci.
> > >
> > > Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
> > > ---
> > >  drivers/staging/sm750fb/ddk750_chip.c | 5 +----
> > >  1 file changed, 1 insertion(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
> > > index 90f5480304f4..93abfa8b0090 100644
> > > --- a/drivers/staging/sm750fb/ddk750_chip.c
> > > +++ b/drivers/staging/sm750fb/ddk750_chip.c
> > > @@ -391,7 +391,6 @@ unsigned int sm750_format_pll_reg(struct pll_value *pPLL)
> > >  	unsigned int OD = pPLL->OD;
> > >  	unsigned int M = pPLL->M;
> > >  	unsigned int N = pPLL->N;
> > > -	unsigned int reg = 0;
> > >
> > >  	/*
> > >  	 * Note that all PLL's have the same format. Here, we just use
> > > @@ -399,13 +398,11 @@ unsigned int sm750_format_pll_reg(struct pll_value *pPLL)
> > >  	 * register. On returning a 32 bit number, the value can be
> > >  	 * applied to any PLL in the calling function.
> > >  	 */
> > > -	reg = PLL_CTRL_POWER |
> > > +	return PLL_CTRL_POWER |
> > >  #ifndef VALIDATION_CHIP
> > >  		((POD << PLL_CTRL_POD_SHIFT) & PLL_CTRL_POD_MASK) |
> > >  #endif
> > >  		((OD << PLL_CTRL_OD_SHIFT) & PLL_CTRL_OD_MASK) |
> > >  		((N << PLL_CTRL_N_SHIFT) & PLL_CTRL_N_MASK) |
> > >  		((M << PLL_CTRL_M_SHIFT) & PLL_CTRL_M_MASK);
> > > -
> > > -	return reg;
> >
> > This is going better in the right direction.  But maybe it is less
> > readable than before, with that very large expression and the ifndef...
> >
> > julia
> >
> > >  }
> > > --
> > > 2.17.1
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190313153205.4974-1-madhumithabiw%40gmail.com.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.20.1903131634500.27312%40hadrien.
> > For more options, visit https://groups.google.com/d/optout.
>
> Do you want me to drop this? As the previous code is more readable than this one.

I don't know.  Greg decides...

julia


      reply	other threads:[~2019-03-13 19:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 15:32 [PATCH] Staging: sm750fb: Remove an unnecessary local variable in a function Madhumitha Prabakaran
2019-03-13 15:35 ` [Outreachy kernel] " Julia Lawall
2019-03-13 15:39   ` Madhumthia Prabakaran
2019-03-13 19:49     ` Julia Lawall [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1903132049340.2515@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=madhumithabiw@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.