Linux RTC
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Jon Nettleton <jon@solid-run.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] rtc: armada38x: drop redundant initialization
Date: Thu, 21 Jun 2018 21:11:33 +0300	[thread overview]
Message-ID: <20180621181133.udrvjul73edmcznt@tarshish> (raw)
In-Reply-To: <20180621175939.GL7737@piout.net>

Hi Alexandre,

On Thu, Jun 21, 2018 at 07:59:39PM +0200, Alexandre Belloni wrote:
> On 21/06/2018 20:40:22+0300, Baruch Siach wrote:
> > The 'ret' variable in these functions is set unconditionally below.
> 
> Hum, what is the actual benefit of this patch?

It is just a small cleanup to reduces somewhat the strain on the reader of the 
code. ret is not different from other variables in the same functions that are 
only initialized when needed.

baruch

> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > ---
> >  drivers/rtc/rtc-armada38x.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/rtc/rtc-armada38x.c b/drivers/rtc/rtc-armada38x.c
> > index 1e4978c96ffd..4d62a54fd5d6 100644
> > --- a/drivers/rtc/rtc-armada38x.c
> > +++ b/drivers/rtc/rtc-armada38x.c
> > @@ -229,7 +229,7 @@ static int armada38x_rtc_read_time(struct device *dev, struct rtc_time *tm)
> >  static int armada38x_rtc_set_time(struct device *dev, struct rtc_time *tm)
> >  {
> >  	struct armada38x_rtc *rtc = dev_get_drvdata(dev);
> > -	int ret = 0;
> > +	int ret;
> >  	unsigned long time, flags;
> >  
> >  	ret = rtc_tm_to_time(tm, &time);
> > @@ -272,7 +272,7 @@ static int armada38x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
> >  	u32 reg = ALARM_REG(RTC_ALARM1, rtc->data->alarm);
> >  	u32 reg_irq = ALARM_REG(RTC_IRQ1_CONF, rtc->data->alarm);
> >  	unsigned long time, flags;
> > -	int ret = 0;
> > +	int ret;
> >  
> >  	ret = rtc_tm_to_time(&alrm->time, &time);
> >  
> > -- 
> > 2.17.1

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

      reply	other threads:[~2018-06-21 18:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21 17:40 [PATCH 1/2] rtc: armada38x: drop redundant initialization Baruch Siach
2018-06-21 17:40 ` [PATCH 2/2] rtc: armada38x: reset after rtc power loss Baruch Siach
2018-06-28 13:56   ` Gregory CLEMENT
2018-07-12 18:36   ` Alexandre Belloni
2018-06-21 17:59 ` [PATCH 1/2] rtc: armada38x: drop redundant initialization Alexandre Belloni
2018-06-21 18:11   ` Baruch Siach [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=20180621181133.udrvjul73edmcznt@tarshish \
    --to=baruch@tkos.co.il \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=gregory.clement@free-electrons.com \
    --cc=jason@lakedaemon.net \
    --cc=jon@solid-run.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=sebastian.hesselbarth@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox