Re: [PATCH 1/2] rtc: armada38x: drop redundant initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> > ---
> >  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@xxxxxxxxxx - tel: +972.52.368.4656, http://www.tkos.co.il -



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux